-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
StableDiffusionXLInpaintPipeline.from_single_file for refiner returns back Img2ImgPipeline #6001
Comments
Could you provide a fuller reproducible code snippet for us to understand the issue better? Cc: @DN6 |
The intent is to get a refiner for inpainting like described here However if I run the code below,
|
@yiyixuxu Could you take a look here please. |
The issue is quite easy to reproduce: from diffusers import StableDiffusionXLInpaintPipeline
import torch
pipe = StableDiffusionXLInpaintPipeline.from_single_file(
"https://huggingface.co/stabilityai/stable-diffusion-xl-base-1.0/blob/main/sd_xl_base_1.0_0.9vae.safetensors",
torch_dtype=torch.float16,
variant="fp16",
use_safetensors=True
)
refiner = StableDiffusionXLInpaintPipeline.from_single_file(
"https://huggingface.co/stabilityai/stable-diffusion-xl-refiner-1.0/blob/main/sd_xl_refiner_1.0_0.9vae.safetensors",
text_encoder_2=pipe.text_encoder_2,
vae=pipe.vae,
torch_dtype=torch.float16,
variant="fp16",
use_safetensors=True
)
print("Refiner", refiner.__class__.__name__) # prints incorrect class @DN6 it would be nice if you can take a look here since we want to refactor the |
There is another similar issue - on diffusers 0.22.3 If I use: Some docs have the first way of calling (in conjunction with refiner) and some docs have the second (autopipeline) way of calling. But the second one is correct. First one config looks suspect, and its not really inpainting due to unet config only 4 channels. |
Describe the bug
When using this call:
StableDiffusionXLInpaintPipeline.from_single_file(/sd_xl_refiner_1.0.safetensors), we get an instance of Img2ImgPipeline rather than Inpainting pipeline.
This seems related to 4186, but in this case Img2ImgPipeline doesnt throw an error when mask_image parameter is passed, it just silently ignores it.
Reproduction
from diffusers import StableDiffusionXLInpaintPipeline
from diffusers.utils import load_image
refiner = StableDiffusionXLInpaintPipeline.from_single_file(
"./sd_xl_refiner_1.0.safetensors",
torch_dtype=torch.float16,
use_safetensors=True,
variant="fp16",
)
refiner.to("cuda")
Logs
No response
System Info
Diffusers 0.23
Who can help?
No response
The text was updated successfully, but these errors were encountered: