Skip to content

[doc] add a tip about using SDXL refiner with hunyuan-dit and pixart #8735

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

Merged
merged 3 commits into from
Jul 1, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions docs/source/en/api/pipelines/hunyuandit.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ Make sure to check out the Schedulers [guide](../../using-diffusers/schedulers.m

</Tip>

<Tip>

Once you have generated an image using [`HunyuanDiTPipeline`], you can pass that image to SDXL refiner to further improve the final generation quality. Check out this [guide](https://huggingface.co/docs/diffusers/using-diffusers/sdxl#base-to-refiner-model) on how to use SDXL refiner model.

</Tip>

## Optimization

You can optimize the pipeline's runtime and memory consumption with torch.compile and feed-forward chunking. To learn about other optimization methods, check out the [Speed up inference](../../optimization/fp16) and [Reduce memory usage](../../optimization/memory) guides.
Expand Down
6 changes: 6 additions & 0 deletions docs/source/en/api/pipelines/pixart_sigma.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ Make sure to check out the Schedulers [guide](../../using-diffusers/schedulers)

</Tip>

<Tip>

Once you have generated an image using [`PixArtSigmaPipeline`], you can pass that image to SDXL refiner to further improve the final generation quality. Check out this [guide](https://huggingface.co/docs/diffusers/using-diffusers/sdxl#base-to-refiner-model) on how to use SDXL refiner model.

</Tip>

## Inference with under 8GB GPU VRAM

Run the [`PixArtSigmaPipeline`] with under 8GB GPU VRAM by loading the text encoder in 8-bit precision. Let's walk through a full-fledged example.
Expand Down
6 changes: 6 additions & 0 deletions docs/source/en/using-diffusers/sdxl.md
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,12 @@ refiner = DiffusionPipeline.from_pretrained(
).to("cuda")
```

<Tip warning={true}>

You can also use SDXL refiner with a different base model. For example,you can use[Hunyuan-DiT](https://huggingface.co/docs/diffusers/api/pipelines/hunyuandit) or [PixArt-Sigma](https://huggingface.co/docs/diffusers/api/pipelines/pixart_sigma) Text-to-Image pipelines to generate images with better prompt adherence. Once you have generated an image, you can then pass it to SDXL refiner to enhance final generation quality.

</Tip>

Generate an image from the base model, and set the model output to **latent** space:

```py
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
>>> pipe = pipe.to(device)

>>> url = "https://raw.githubusercontent.com/CompVis/stable-diffusion/main/assets/stable-samples/img2img/sketch-mountains-input.jpg"
>>> init_image = load_image(url).resize((512, 512))
>>> init_image = load_image(url).resize((1024, 1024))

>>> prompt = "cat wizard, gandalf, lord of the rings, detailed, fantasy, cute, adorable, Pixar, Disney, 8k"

Expand Down
Loading