kohya-ss / kohya-ss/sd-scripts

Inpaint not working on SDXL using sdxl_gen_img.py

Open
#735 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
7.2k
Forks
1.2k
Avg merge
11m
Merged PRs (30d)
2

Description

When I try to generate images using:
"python sdxl_gen_img.py --outdir "outputs" --ckpt stabilityai/stable-diffusion-xl-base-1.0 --steps 40 --strength 0.8 --prompt "A picture of a chair" --network_module networks.lora --network_weights test_output/test_output-step00001500.safetensors --image_path "inpaint-images/input/input0.jpeg" --mask_path "inpaint-images/input/input0-mask.jpg""
My images get weirdly distorted all over. --fp16 returns black images, but that apparently has something to do with the VAE. using --bf16 or the standard float32 as above, does not resolve the issue. I will add the mask and the init_image below, as well as the generated image.

![im_20230808125017_000_57285212](https://github.com/kohya-ss/sd-scripts/assets/43959931/50fa15aa-4cec-4faa-b64e-6074ed5bea17)
![input0-mask](https://github.com/kohya-ss/sd-scripts/assets/43959931/a6de456c-f0e4-423f-a5fe-bac4e2b977ec)
![input0](https://github.com/kohya-ss/sd-scripts/assets/43959931/3995d28c-e9ae-423c-b5df-ecaff13233c6)

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the exact command through sdxl_gen_img.py with the attached input image and mask, then inspect the SDXL inpainting path and its precision/VAE handling. Done means the masked image no longer becomes distorted and the reported fp16 behavior is understood or corrected.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
machine-learning
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.