Skip to content

Conversation

@puhuk
Copy link
Contributor

@puhuk puhuk commented Feb 19, 2025

What does this PR do?

Fixes #10817
Updated auto_pipeline.py to properly register and load ControlNet variants for SD3 models.

Before submitting

Who can review?

@yiyixuxu @asomoza @hlky

Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.

@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@puhuk
Copy link
Contributor Author

puhuk commented Feb 19, 2025

I ran the test in my local environment, and it passed. Could I be missing something?

image

@yiyixuxu
Copy link
Collaborator

yiyixuxu commented Feb 20, 2025

Thanks for the PR!

we need to make sure we can use AutoPipeline for sd3 controlnet
i.e. something like this, and also the from_pipe use case!

can you test them?

import torch
from diffusers import AutoPipelineForText2Image
from diffusers.models import SD3ControlNetModel, SD3MultiControlNetModel
from diffusers.utils import load_image

controlnet = SD3ControlNetModel.from_pretrained("InstantX/SD3-Controlnet-Canny", torch_dtype=torch.float16)
pipe = AutoPipelineForText2Image.from_pretrained(
    "stabilityai/stable-diffusion-3-medium-diffusers", controlnet=controlnet, torch_dtype=torch.float16
)
pipe.to("cuda")

control_image = load_image(
    "https://huggingface.co/datasets/hf-internal-testing/diffusers-images/resolve/main/sd_controlnet/bird_canny.png"
)
prompt = "A bird in space"
image = pipe(
    prompt, control_image=control_image, height=1024, width=768, controlnet_conditioning_scale=0.7
).images[0]
image.save("sd3.png")

@puhuk
Copy link
Contributor Author

puhuk commented Feb 22, 2025

@yiyixuxu It works :)

Copy link
Contributor

@hlky hlky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @puhuk

@yiyixuxu 408c110 d656a22 uncaught previously, affected check_torch_dependencies

@puhuk puhuk closed this Feb 23, 2025
@puhuk puhuk deleted the issue_10817 branch February 23, 2025 11:08
@yiyixuxu
Copy link
Collaborator

hi @puhuk thanks for the PR, not sure why it was closed
just want to let you know @hlky made you an author in #10888 and we merged in that PR. hope it is ok

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

auto_pipeline missing SD3 contol nets

4 participants