Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
S
Stable Diffusion Webui
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
novelai-storage
Stable Diffusion Webui
Commits
a1aa0af8
Commit
a1aa0af8
authored
Apr 22, 2024
by
drhead
Committed by
GitHub
Apr 22, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add code for skipping CFG on early steps
parent
1c0a0c4c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
0 deletions
+5
-0
modules/sd_samplers_cfg_denoiser.py
modules/sd_samplers_cfg_denoiser.py
+5
-0
No files found.
modules/sd_samplers_cfg_denoiser.py
View file @
a1aa0af8
...
@@ -212,6 +212,11 @@ class CFGDenoiser(torch.nn.Module):
...
@@ -212,6 +212,11 @@ class CFGDenoiser(torch.nn.Module):
uncond
=
denoiser_params
.
text_uncond
uncond
=
denoiser_params
.
text_uncond
skip_uncond
=
False
skip_uncond
=
False
if
self
.
step
<
shared
.
opts
.
skip_cond_steps
:
skip_uncond
=
True
x_in
=
x_in
[:
-
batch_size
]
sigma_in
=
sigma_in
[:
-
batch_size
]
# alternating uncond allows for higher thresholds without the quality loss normally expected from raising it
# alternating uncond allows for higher thresholds without the quality loss normally expected from raising it
if
self
.
step
%
2
and
s_min_uncond
>
0
and
sigma
[
0
]
<
s_min_uncond
and
not
is_edit_model
:
if
self
.
step
%
2
and
s_min_uncond
>
0
and
sigma
[
0
]
<
s_min_uncond
and
not
is_edit_model
:
skip_uncond
=
True
skip_uncond
=
True
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment