Instructions to use PrunaAI/P-Q-Image-2.1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use PrunaAI/P-Q-Image-2.1 with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("Qwen/Qwen-Image-2.1", dtype=torch.bfloat16, device_map="cuda") pipe.load_lora_weights("PrunaAI/P-Q-Image-2.1") prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" image = pipe(prompt).images[0] - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- Draw Things
- DiffusionBee
Correct BF16 timestep embedding in Diffusers example
Browse files
README.md
CHANGED
|
@@ -19,7 +19,7 @@ tags:
|
|
| 19 |
|
| 20 |
# Qwen-Image-2.1-P-Turbo
|
| 21 |
|
| 22 |
-
**Improved using Qwen.** A five-step LoRA adapter for [Qwen Image 2.1](https://huggingface.co/Qwen/Qwen-Image-2.1). The adapter weights are a modification of the base model; its license applies. The `_comfyui_bf16.safetensors` file is for ComfyUI. Use LoRA strength 1.0, float32 Euler updates, and sigma schedule `1 → 13/14 → 6/7 → 2/3 → 0.4 → 0`.
|
| 23 |
|
| 24 |
## Quick Start
|
| 25 |
|
|
@@ -51,6 +51,9 @@ pipe.load_lora_weights(
|
|
| 51 |
"PrunaAI/Qwen-Image-2.1-P-Turbo",
|
| 52 |
weight_name="p_qwen_image_2.1_5step_v1.0.safetensors",
|
| 53 |
)
|
|
|
|
|
|
|
|
|
|
| 54 |
pipe.scheduler = Float32EulerScheduler.from_config(
|
| 55 |
pipe.scheduler.config,
|
| 56 |
use_dynamic_shifting=False,
|
|
|
|
| 19 |
|
| 20 |
# Qwen-Image-2.1-P-Turbo
|
| 21 |
|
| 22 |
+
**Improved using Qwen.** A five-step LoRA adapter for [Qwen Image 2.1](https://huggingface.co/Qwen/Qwen-Image-2.1). The adapter weights are a modification of the base model; its license applies. The `_comfyui_bf16.safetensors` file is for ComfyUI. Use LoRA strength 1.0, BF16 timestep frequencies, float32 Euler updates, and sigma schedule `1 → 13/14 → 6/7 → 2/3 → 0.4 → 0`.
|
| 23 |
|
| 24 |
## Quick Start
|
| 25 |
|
|
|
|
| 51 |
"PrunaAI/Qwen-Image-2.1-P-Turbo",
|
| 52 |
weight_name="p_qwen_image_2.1_5step_v1.0.safetensors",
|
| 53 |
)
|
| 54 |
+
# Match the BF16 timestep embedding used by this adapter.
|
| 55 |
+
time_proj = pipe.transformer.time_text_embed.time_proj
|
| 56 |
+
time_proj.freqs = time_proj.freqs.to(torch.bfloat16)
|
| 57 |
pipe.scheduler = Float32EulerScheduler.from_config(
|
| 58 |
pipe.scheduler.config,
|
| 59 |
use_dynamic_shifting=False,
|