Skip to content

Commit 764fd69

Browse files
committed
move model to community
1 parent c517579 commit 764fd69

File tree

4 files changed

+1298
-126
lines changed

4 files changed

+1298
-126
lines changed

examples/community/README.md

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ PIXART-α Controlnet pipeline | Implementation of the controlnet model for pixar
8787
| 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) |
8888
| 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://huggingface.co/papers/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) | [![Hugging Face Models](https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-Models-blue)](https://huggingface.co/jychen9811/FaithDiff) | [Junyang Chen, Jinshan Pan, Jiangxin Dong, IMAG Lab, (Adapted by Eliseu Silva)](https://github.com/JyChen9811/FaithDiff) |
8989
| 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://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-Models-blue)](https://huggingface.co/BleachNick/SD3_UltraEdit_freeform) [![Hugging Face Models](https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-Models-blue)](https://huggingface.co/CaptainZZZ/sd3-instructpix2pix) | [Jiayu Zhang](https://github.com/xduzhangjiayu) and [Haozhe Zhao](https://github.com/HaozheZhao)|
90+
| Flux Kontext multiple images | Allow to call Flux Kontext by giving several images. These images will be separatly encoded in the latent space, then the latent vector will be concatenated | [Flux Kontext multiple input Pipeline](#flux-kontext-multiple images) | - | https://github.com/Net-Mist |
9091
To load a custom pipeline you just need to pass the `custom_pipeline` argument to `DiffusionPipeline`, as one of the files in `diffusers/examples/community`. Feel free to send a PR with your own pipelines, we will merge them quickly.
9192

9293
```py
@@ -5479,4 +5480,50 @@ edited_image.save("edited_image.png")
54795480
### Note
54805481
This model is trained on 512x512, so input size is better on 512x512.
54815482
For better editing performance, please refer to this powerful model https://huggingface.co/BleachNick/SD3_UltraEdit_freeform and Paper "UltraEdit: Instruction-based Fine-Grained Image
5482-
Editing at Scale", many thanks to their contribution!
5483+
Editing at Scale", many thanks to their contribution!
5484+
5485+
# Flux Kontext multiple images
5486+
5487+
This is an implementation of Flux Kontext allowing the user to pass multiple reference images.
5488+
5489+
These images will be encoded separatly and the latent vectors will be concatenated.
5490+
5491+
as explained section 3 of [the paper](https://arxiv.org/pdf/2506.15742), the sequence concatenation mecanism of the model can extends the model capabilities to several images (however note that the current version of Flux-Kontext wasn't train for this). Currently, stacking on the first axis doesn't seem to give correct results, but stacking on the other 2 works.
5492+
5493+
## Example Usage
5494+
5495+
This pipeline loads 2 reference images, and generate an image using them.
5496+
5497+
```python
5498+
import torch
5499+
5500+
from diffusers import FluxKontextPipeline
5501+
from diffusers.utils import load_image
5502+
5503+
5504+
pipe = FluxKontextPipeline.from_pretrained(
5505+
"black-forest-labs/FLUX.1-Kontext-dev",
5506+
torch_dtype=torch.bfloat16,
5507+
custom_pipeline="pipeline_flux_kontext_multiple_images",
5508+
)
5509+
pipe.to("cuda")
5510+
5511+
pikachu_image = load_image(
5512+
"https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/yarn-art-pikachu.png"
5513+
).convert("RGB")
5514+
cat_image = load_image(
5515+
"https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/cat.png"
5516+
).convert("RGB")
5517+
5518+
5519+
prompts = [
5520+
"Pikachu and the cat are sitting together at a pizzeria table, enjoying a delicious pizza.",
5521+
]
5522+
images = pipe(
5523+
multiple_images=[(pikachu_image, cat_image)],
5524+
prompt=prompts,
5525+
guidance_scale=2.5,
5526+
generator=torch.Generator().manual_seed(42),
5527+
).images
5528+
images[0].save("pizzeria.png")
5529+
```

0 commit comments

Comments
 (0)