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
6adf2b71
Commit
6adf2b71
authored
Aug 30, 2023
by
AUTOMATIC1111
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix inpainting models in txt2img creating black pictures
parent
ae0b2cc1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
modules/processing.py
modules/processing.py
+2
-2
No files found.
modules/processing.py
View file @
6adf2b71
...
...
@@ -91,8 +91,8 @@ def create_binary_mask(image):
def
txt2img_image_conditioning
(
sd_model
,
x
,
width
,
height
):
if
sd_model
.
model
.
conditioning_key
in
{
'hybrid'
,
'concat'
}:
# Inpainting models
# The "masked-image" in this case will just be all
zeros
since the entire image is masked.
image_conditioning
=
torch
.
zeros
(
x
.
shape
[
0
],
3
,
height
,
width
,
device
=
x
.
device
)
# The "masked-image" in this case will just be all
0.5
since the entire image is masked.
image_conditioning
=
torch
.
ones
(
x
.
shape
[
0
],
3
,
height
,
width
,
device
=
x
.
device
)
*
0.5
image_conditioning
=
images_tensor_to_samples
(
image_conditioning
,
approximation_indexes
.
get
(
opts
.
sd_vae_encode_method
))
# Add the fake full 1s mask to the first dimension.
...
...
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