-
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
StableDiffusionXLInstructPix2PixPipeline
doesn't work with cosxl_edit
#7621
Comments
should be able to get the checkpoint in import torch
from diffusers import StableDiffusionXLInstructPix2PixPipeline
pipe = StableDiffusionXLInstructPix2PixPipeline.from_single_file(
"https://huggingface.co/stabilityai/cosxl/blob/main/cosxl.safetensors", num_in_channels=8,
) |
cc @DN6 here we should support every model listed in here https://github.com/comfyanonymous/ComfyUI/blob/4201181b35402e0a992b861f8d2f0e0b267f52fa/comfy/supported_models.py#L479 |
Not sure if it's the exact guidance formulation that we have in the InstructPix2Pix pipeline though. That would matter a lot. If it's possible, could you try to initialize the unet = ...
text_encoder = ...
text_encoder_2 = ...
vae = ...
scheduler = ...
pipeline = ... |
ComfyUI uses the same This are the nodes for the comfyui official edit workflow
As I'm using |
just have to scale the image_latents adding this to the pipeline # 6. Prepare Image latents
image_latents = self.prepare_image_latents(
image,
batch_size,
num_images_per_prompt,
prompt_embeds.dtype,
device,
do_classifier_free_guidance,
)
image_latents = latents * self.vae.config.scaling_factor |
Nice finding. However, the SD Pix2Pix doesn't have it :o |
Awesome! What's the best way to proceed here? Modify the pipeline to detect if scaling is needed or not or create a new one? |
I think the following could work:
WDYT? @yiyixuxu would love your thoughts too. |
I think we should modify the pipeline to detect if scaling is needed based on my understanding, how we scale latent is not dependent on the scheduler type but more specific to how this model is trained, i.e. in most of our pipelines, the diffusers/src/diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl_inpaint.py Line 946 in 8e14535
so I think we should add a pipeline config e.g. something like cc @DN6 here |
If we introduce that only for |
If the argument is added to the pipeline and is only a pipeline argument then that wouldn't be a discrepancy. What we want is to avoid configuring models via pipeline invocations |
Like this? pipe = StableDiffusionXLInstructPix2PixPipeline.from_single_file(
"https://huggingface.co/stabilityai/cosxl/blob/main/cosxl.safetensors", num_in_channels=8,
) |
This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread. Please note that issues that do not follow the contributing guidelines are likely to be ignored. |
Describe the bug
CosXL Edit is an InstructPix2Pix model (https://huggingface.co/stabilityai/cosxl) released together with CosXL, however trying to load it gives a size mismatch error
Reproduction
Logs
The text was updated successfully, but these errors were encountered: