Uh oh!
There was an error while loading. Please reload this page.
Add StableDiffusion3InstructPix2PixPipeline - #11378
Conversation
asomoza
commented
Apr 22, 2025
Hi and thanks for your contribution. Is there a model for this pipeline so I can test it? |
Hi, thanks for the reply! |
asomoza
commented
Apr 23, 2025
I did a test but I get a bad result: importtorchfromdiffusers.pipelines.stable_diffusion_3.pipeline_stable_diffusion_3_instruct_pix2piximport (
StableDiffusion3InstructPix2PixPipeline,
)
fromdiffusers.utilsimportload_imageresolution=1024image=load_image("https://hf.co/datasets/diffusers/diffusers-images-docs/resolve/main/mountain.png").resize(
(resolution, resolution)
)
edit_instruction="Turn sky into a cloudy one"pipe=StableDiffusion3InstructPix2PixPipeline.from_pretrained(
"BleachNick/SD3_UltraEdit_freeform", torch_dtype=torch.float16
)
pipe.enable_model_cpu_offload()
edited_image=pipe(
prompt=edit_instruction,
image=image,
height=resolution,
width=resolution,
guidance_scale=7.5,
image_guidance_scale=1.5,
num_inference_steps=30,
).images[0]
edited_image.save("edited_image.png")and I get this image: I also tried with changing the transformer model with yours but got the same result. I don't have the time to look into this right now, can you solve the issue? Also ideally if this works, you will need to add the corresponding doc page and to be able to load it like the example in the dosctring But still, the priority here should be to make it work and to demo an example with it. |
Hi @asomoza And could you please tell me where I should add the doc page? Thanks~ |
asomoza
commented
Apr 24, 2025
@xduzhangjiayu the code I used was the one that's in the docstring of the pipeline, so probably it's better to change it there.
For the docs, it's inside the But looking at the quality of the model and the work involved, I would recommend to move this pipeline to the community examples, it would be easier to do and also we can move it to core if it gets popular later, this way you don't have to write docs and we can merge it faster. |
xduzhangjiayu
commented
Apr 29, 2025
Hi @asomoza |
asomoza
commented
Apr 29, 2025
@xduzhangjiayu thanks, can you please add a small description and a functional snipped of code to run it in the README file. |
xduzhangjiayu
commented
Apr 29, 2025
Hi @asomoza |
asomoza
commented
Apr 29, 2025
we don't use the same directory for hosting images, I took the liberty to upload your images to the hub here: https://huggingface.co/datasets/diffusers/docs-images/resolve/main/StableDiffusion3InstructPix2Pix/mountain.png can you delete the images from this PR and use these links instead please? |
xduzhangjiayu
commented
Apr 29, 2025
@asomoza Done |
HuggingFaceDocBuilderDev
commented
Apr 29, 2025
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. |
| | Perturbed-Attention Guidance |StableDiffusionPAGPipeline is a modification of StableDiffusionPipeline to support Perturbed-Attention Guidance (PAG).|[Perturbed-Attention Guidance](#perturbed-attention-guidance)|[Notebook](https://github.com/huggingface/notebooks/blob/main/diffusers/perturbed_attention_guidance.ipynb)|[Hyoungwon Cho](https://github.com/HyoungwonCho)| | ||
| | CogVideoX DDIM Inversion Pipeline | Implementation of DDIM inversion and guided attention-based editing denoising process on CogVideoX. | [CogVideoX DDIM Inversion Pipeline](#cogvideox-ddim-inversion-pipeline) | - | [LittleNyima](https://github.com/LittleNyima) | | ||
| | FaithDiff Stable Diffusion XL Pipeline | Implementation of [(CVPR 2025) FaithDiff: Unleashing Diffusion Priors for Faithful Image Super-resolutionUnleashing Diffusion Priors for Faithful Image Super-resolution](https://arxiv.org/abs/2411.18824) - FaithDiff is a faithful image super-resolution method that leverages latent diffusion models by actively adapting the diffusion prior and jointly fine-tuning its components (encoder and diffusion model) with an alignment module to ensure high fidelity and structural consistency. | [FaithDiff Stable Diffusion XL Pipeline](#faithdiff-stable-diffusion-xl-pipeline) | [](https://huggingface.co/jychen9811/FaithDiff) | [Junyang Chen, Jinshan Pan, Jiangxin Dong, IMAG Lab, (Adapted by Eliseu Silva)](https://github.com/JyChen9811/FaithDiff) | | ||
| | Stable Diffusion 3 InstructPix2Pix Pipeline | Implementation of Stable Diffusion 3 InstructPix2Pix Pipeline | [Stable Diffusion 3 InstructPix2Pix Pipeline](#stable-diffusion-3-instructpix2pix-pipeline) | [![Hugging Face Models]()](https://huggingface.co/BleachNick/SD3_UltraEdit_freeform) [![Hugging Face Models]()](https://huggingface.co/CaptainZZZ/sd3-instructpix2pix) | [Jiayu Zhang](https://github.com/xduzhangjiayu) and [Haozhe Zhao](https://github.com/HaozheZhao)| |
There was a problem hiding this comment.
| | Stable Diffusion 3 InstructPix2Pix Pipeline | Implementation of Stable Diffusion 3 InstructPix2Pix Pipeline |[Stable Diffusion 3 InstructPix2Pix Pipeline](#stable-diffusion-3-instructpix2pix-pipeline)|[![Hugging Face Models]()](https://huggingface.co/BleachNick/SD3_UltraEdit_freeform)[![Hugging Face Models]()](https://huggingface.co/CaptainZZZ/sd3-instructpix2pix)|[Jiayu Zhang](https://github.com/xduzhangjiayu) and [Haozhe Zhao](https://github.com/HaozheZhao)| | |
| | Stable Diffusion 3 InstructPix2Pix Pipeline | Implementation of Stable Diffusion 3 InstructPix2Pix Pipeline |[Stable Diffusion 3 InstructPix2Pix Pipeline](#stable-diffusion-3-instructpix2pix-pipeline)|[](https://huggingface.co/BleachNick/SD3_UltraEdit_freeform)[](https://huggingface.co/CaptainZZZ/sd3-instructpix2pix)|[Jiayu Zhang](https://github.com/xduzhangjiayu) and [Haozhe Zhao](https://github.com/HaozheZhao)| |
| ### Result | ||
|  | ||
|  |
There was a problem hiding this comment.
| ### Result | |
|  | |
|  | |
| |Original|Edited| | |
| |---|---| | |
| || |
xduzhangjiayu
commented
Apr 30, 2025
@asomoza OK, done |
asomoza
commented
Apr 30, 2025
@bot /style |
Style fixes have been applied. View the workflow run here. |
asomoza
commented
Apr 30, 2025
thanks! |


What does this PR do?
Add StableDiffusion3InstructPix2PixPipeline
Would you like give a review? Many thanks~ @yiyixuxu@asomoza