-
Notifications
You must be signed in to change notification settings - Fork 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
getting bug on diffuser example #8638
Comments
|
@haofanwang thnx alot bro was mistakenly though xl its pretty weird how it able to load the model without giving us warning xD |
@haofanwang sorry for trouble u again but it not load the sdxl model rather it load sd model |
Hi, can you please post the code as text and not as an image, it makes it a lot harder to read and to test. |
import cv2
from diffusers import StableDiffusionXLControlNetInpaintPipeline, ControlNetModel, DDIMScheduler
from diffusers.utils import load_image
import numpy as np
import torch
init_image = load_image("https://huggingface.co/datasets/diffusers/test-arrays/resolve/main/stable_diffusion_inpaint/boy.png")
init_image = init_image.resize((1024, 1024))
generator = torch.Generator(device="cpu").manual_seed(1)
mask_image = load_image("https://huggingface.co/datasets/diffusers/test-arrays/resolve/main/stable_diffusion_inpaint/boy_mask.png")
mask_image = mask_image.resize((1024, 1024))
modelp = "models_painting/dreamshaperXL_lightningInpaint.safetensors"
def make_canny_condition(image):
image = np.array(image)
image = cv2.Canny(image, 100, 200)
image = image[:, :, None]
image = np.concatenate([image, image, image], axis=2)
image = Image.fromarray(image)
return image
control_image = make_canny_condition(init_image)
controlnet = ControlNetModel.from_pretrained("diffusers/controlnet-canny-sdxl-1.0",variant="fp16", torch_dtype=torch.float16)
pipe = StableDiffusionXLControlNetInpaintPipeline.from_single_file(modelp, controlnet=controlnet, torch_dtype=torch.float16)
pipe.enable_model_cpu_offload()
image = pipe(
"a handsome man with ray-ban sunglasses",
num_inference_steps=20,
generator=generator,
eta=1.0,
image=init_image,
mask_image=mask_image,
control_image=control_image,
).images[0] between bro it was same code of ur example was provided the link on top havent tested with other model just low on space right now so only some inpaint model |
I learned the hard way that almost never is the same code, that's why we kindly ask for the same minimal reproducible code you can share for the issues. For example, just out of the box, you're using pillow (without the import?) and Nevertheless I tested it with the same model and with one that I know it worked before and I can reproduce this issue, it seems this happens with the Probably this won't be resolved fast so I suggest you use a diffusers format one like this one or install the 0.27.2 version of diffusers. P.S.: the pillow error is in the docs too, my mistake. cc: @stevhliu |
ah thnx bro again guess will follow ur link >.</ |
Closing this as this seems to have been resolved. Feel free to reopen. |
modelp is "dreamshaper_8Inpainting.safetensors"
https://huggingface.co/docs/diffusers/v0.29.0/en/api/pipelines/controlnet_sdxl#diffusers.StableDiffusionXLControlNetInpaintPipeline
tried compel as well it failed
![image](https://private-user-images.githubusercontent.com/103671642/341052912-6b5ffff9-dfdc-4aab-9720-d2216dffb37e.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjIyNzA5NTMsIm5iZiI6MTcyMjI3MDY1MywicGF0aCI6Ii8xMDM2NzE2NDIvMzQxMDUyOTEyLTZiNWZmZmY5LWRmZGMtNGFhYi05NzIwLWQyMjE2ZGZmYjM3ZS5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwNzI5JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDcyOVQxNjMwNTNaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT0yZmM1MzhhMjNhMGFlZGQ4YjJhZjJjYmQ1ZDFhNDE3M2NlNTM5MTc3OTRiMDIxODhkNDQxZWFhMmI0ZTBmODA5JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.FOLKb7KBLp6IFSPv4RbIgrRLpLj0xDTLRunlBevWAbU)
using diffuser 0.29.0
The text was updated successfully, but these errors were encountered: