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
c88dcc20
Commit
c88dcc20
authored
Feb 10, 2023
by
space-nuko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
UniPC does not support img2img (for now)
parent
21880eb9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
3 deletions
+3
-3
modules/processing.py
modules/processing.py
+1
-1
modules/sd_samplers.py
modules/sd_samplers.py
+1
-1
modules/sd_samplers_compvis.py
modules/sd_samplers_compvis.py
+1
-1
No files found.
modules/processing.py
View file @
c88dcc20
...
@@ -884,7 +884,7 @@ class StableDiffusionProcessingTxt2Img(StableDiffusionProcessing):
...
@@ -884,7 +884,7 @@ class StableDiffusionProcessingTxt2Img(StableDiffusionProcessing):
shared
.
state
.
nextjob
()
shared
.
state
.
nextjob
()
img2img_sampler_name
=
'DDIM'
# PLMS does not support img2img so we just silently switch ot DDIM
img2img_sampler_name
=
'DDIM'
# PLMS
/UniPC
does not support img2img so we just silently switch ot DDIM
self
.
sampler
=
sd_samplers
.
create_sampler
(
img2img_sampler_name
,
self
.
sd_model
)
self
.
sampler
=
sd_samplers
.
create_sampler
(
img2img_sampler_name
,
self
.
sd_model
)
samples
=
samples
[:,
:,
self
.
truncate_y
//
2
:
samples
.
shape
[
2
]
-
(
self
.
truncate_y
+
1
)
//
2
,
self
.
truncate_x
//
2
:
samples
.
shape
[
3
]
-
(
self
.
truncate_x
+
1
)
//
2
]
samples
=
samples
[:,
:,
self
.
truncate_y
//
2
:
samples
.
shape
[
2
]
-
(
self
.
truncate_y
+
1
)
//
2
,
self
.
truncate_x
//
2
:
samples
.
shape
[
3
]
-
(
self
.
truncate_x
+
1
)
//
2
]
...
...
modules/sd_samplers.py
View file @
c88dcc20
...
@@ -32,7 +32,7 @@ def set_samplers():
...
@@ -32,7 +32,7 @@ def set_samplers():
global
samplers
,
samplers_for_img2img
global
samplers
,
samplers_for_img2img
hidden
=
set
(
shared
.
opts
.
hide_samplers
)
hidden
=
set
(
shared
.
opts
.
hide_samplers
)
hidden_img2img
=
set
(
shared
.
opts
.
hide_samplers
+
[
'PLMS'
])
hidden_img2img
=
set
(
shared
.
opts
.
hide_samplers
+
[
'PLMS'
,
'UniPC'
])
samplers
=
[
x
for
x
in
all_samplers
if
x
.
name
not
in
hidden
]
samplers
=
[
x
for
x
in
all_samplers
if
x
.
name
not
in
hidden
]
samplers_for_img2img
=
[
x
for
x
in
all_samplers
if
x
.
name
not
in
hidden_img2img
]
samplers_for_img2img
=
[
x
for
x
in
all_samplers
if
x
.
name
not
in
hidden_img2img
]
...
...
modules/sd_samplers_compvis.py
View file @
c88dcc20
...
@@ -139,7 +139,7 @@ class VanillaStableDiffusionSampler:
...
@@ -139,7 +139,7 @@ class VanillaStableDiffusionSampler:
self
.
nmask
=
p
.
nmask
if
hasattr
(
p
,
'nmask'
)
else
None
self
.
nmask
=
p
.
nmask
if
hasattr
(
p
,
'nmask'
)
else
None
def
adjust_steps_if_invalid
(
self
,
p
,
num_steps
):
def
adjust_steps_if_invalid
(
self
,
p
,
num_steps
):
if
((
self
.
config
.
name
==
'DDIM'
or
self
.
config
.
name
==
"UniPC"
)
and
p
.
ddim_discretize
==
'uniform'
)
or
(
self
.
config
.
name
==
'PLMS
'
):
if
((
self
.
config
.
name
==
'DDIM'
)
and
p
.
ddim_discretize
==
'uniform'
)
or
(
self
.
config
.
name
==
'PLMS'
)
or
(
self
.
config
.
name
==
'UniPC
'
):
valid_step
=
999
/
(
1000
//
num_steps
)
valid_step
=
999
/
(
1000
//
num_steps
)
if
valid_step
==
math
.
floor
(
valid_step
):
if
valid_step
==
math
.
floor
(
valid_step
):
return
int
(
valid_step
)
+
1
return
int
(
valid_step
)
+
1
...
...
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