-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Issue with Using Multiple Controls (Depth and Canny) with LoRA on FLUX.1-dev Model #10594
Comments
Can you perform inference sucessfully when using a single LoRA and multiple control images? |
@pramishp You pasted code with your exposed HF_TOKEN. I've edited the example to remove the token and removed the edit from the revision history. Please revoke/rotate the token on your end |
@a-r-r-o-w , my bad. Thanks ! |
@sayakpaul , I get the same error on using single LoRA and multiple control images. |
And what happens when we use the full Control model such as this? # !pip install -U controlnet-aux
import torch
from controlnet_aux import CannyDetector
from diffusers import FluxControlPipeline
from diffusers.utils import load_image
pipe = FluxControlPipeline.from_pretrained("black-forest-labs/FLUX.1-Canny-dev", torch_dtype=torch.bfloat16).to("cuda")
prompt = "A robot made of exotic candies and chocolates of different kinds. The background is filled with confetti and celebratory gifts."
control_image = load_image("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/robot.png")
processor = CannyDetector()
control_image = processor(control_image, low_threshold=50, high_threshold=200, detect_resolution=1024, image_resolution=1024)
image = pipe(
prompt=prompt,
control_image=control_image,
height=1024,
width=1024,
num_inference_steps=50,
guidance_scale=30.0,
).images[0]
image.save("output.png") So, multiple control image is broken, IIUC. Cc: @yiyixuxu |
Full control models like Canny and Depth works fine. I have played with Depth version and it works perfectly. The problem is using multiple controls. There's even one example in docs though it's for different controls. |
So, you mean to say the following works: image = control_pipe(
prompt=prompt,
control_image=[control_image1, control_image2],
height=1024,
width=1024,
num_inference_steps=30,
guidance_scale=10.0,
generator=torch.Generator().manual_seed(42),
).images[0] where ? |
@sayakpaul , No ! I haven't tried this. But, this likely won't work. In my above comment, I was referring to the case with single control input for control models like full Depth and Canny. |
hi @pramishp
|
Describe the bug
When attempting to use multiple control images (Depth and Canny) with LoRA on the FLUX.1-dev model, an error occurs during execution. The documentation indicates that multiple control images in PIL format can be supplied, but the pipeline throws a runtime error. Notably, the pipeline functions correctly with a single control image.
Expected Behavior
The pipeline should generate the output image without errors when multiple control images (Depth and Canny) are supplied.
Observed Behavior
The pipeline fails with the error RuntimeError: shape '[1, 16, 64, 2, 64, 2]' is invalid for input of size 524288.
Reproduction
System Info
Who can help?
@sayakpaul @yiyixuxu @DN6
The text was updated successfully, but these errors were encountered: