diff options
author | AUTOMATIC1111 <16777216c@gmail.com> | 2023-08-30 16:08:04 +0000 |
---|---|---|
committer | AUTOMATIC1111 <16777216c@gmail.com> | 2023-08-30 16:08:04 +0000 |
commit | 6adf2b71c2c89f84d4aee1e230276dcd1a3fab62 (patch) | |
tree | b285be871b05339313b3a6624c30cf0c015a11ba /modules | |
parent | ae0b2cc1964486ba847290ad752d9a284b6d63ba (diff) | |
download | stable-diffusion-webui-gfx803-6adf2b71c2c89f84d4aee1e230276dcd1a3fab62.tar.gz stable-diffusion-webui-gfx803-6adf2b71c2c89f84d4aee1e230276dcd1a3fab62.tar.bz2 stable-diffusion-webui-gfx803-6adf2b71c2c89f84d4aee1e230276dcd1a3fab62.zip |
fix inpainting models in txt2img creating black pictures
Diffstat (limited to 'modules')
-rw-r--r-- | modules/processing.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/processing.py b/modules/processing.py index f696e925..e08b6305 100644 --- a/modules/processing.py +++ b/modules/processing.py @@ -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.
|