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
0b646335
Commit
0b646335
authored
Jun 28, 2024
by
AUTOMATIC1111
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix img2img
parent
0c7bdcc1
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
4 deletions
+10
-4
modules/models/sd3/sd3_model.py
modules/models/sd3/sd3_model.py
+3
-0
modules/processing.py
modules/processing.py
+3
-3
modules/sd_samplers_kdiffusion.py
modules/sd_samplers_kdiffusion.py
+4
-1
No files found.
modules/models/sd3/sd3_model.py
View file @
0b646335
...
...
@@ -73,3 +73,6 @@ class SD3Inferencer(torch.nn.Module):
(
self
,
'cond_stage_model'
),
(
self
,
'model'
),
]
def
add_noise_to_latent
(
self
,
x
,
noise
,
amount
):
return
x
*
(
1
-
amount
)
+
noise
*
amount
modules/processing.py
View file @
0b646335
...
...
@@ -1737,10 +1737,10 @@ class StableDiffusionProcessingImg2Img(StableDiffusionProcessing):
latmask
=
latmask
[
0
]
if
self
.
mask_round
:
latmask
=
np
.
around
(
latmask
)
latmask
=
np
.
tile
(
latmask
[
None
],
(
4
,
1
,
1
))
latmask
=
np
.
tile
(
latmask
[
None
],
(
self
.
init_latent
.
shape
[
1
]
,
1
,
1
))
self
.
mask
=
torch
.
asarray
(
1.0
-
latmask
)
.
to
(
shared
.
device
)
.
type
(
self
.
sd_model
.
dtype
)
self
.
nmask
=
torch
.
asarray
(
latmask
)
.
to
(
shared
.
device
)
.
type
(
self
.
sd_model
.
dtype
)
self
.
mask
=
torch
.
asarray
(
1.0
-
latmask
)
.
to
(
shared
.
device
)
.
type
(
devices
.
dtype
)
self
.
nmask
=
torch
.
asarray
(
latmask
)
.
to
(
shared
.
device
)
.
type
(
devices
.
dtype
)
# this needs to be fixed to be done in sample() using actual seeds for batches
if
self
.
inpainting_fill
==
2
:
...
...
modules/sd_samplers_kdiffusion.py
View file @
0b646335
...
...
@@ -133,7 +133,10 @@ class KDiffusionSampler(sd_samplers_common.Sampler):
sigmas
=
self
.
get_sigmas
(
p
,
steps
)
sigma_sched
=
sigmas
[
steps
-
t_enc
-
1
:]
xi
=
x
+
noise
*
sigma_sched
[
0
]
if
hasattr
(
shared
.
sd_model
,
'add_noise_to_latent'
):
xi
=
shared
.
sd_model
.
add_noise_to_latent
(
x
,
noise
,
sigma_sched
[
0
])
else
:
xi
=
x
+
noise
*
sigma_sched
[
0
]
if
opts
.
img2img_extra_noise
>
0
:
p
.
extra_generation_params
[
"Extra noise"
]
=
opts
.
img2img_extra_noise
...
...
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