Instructions to use PrunaAI/Pruna-Q-Image-2.1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use PrunaAI/Pruna-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/Pruna-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
Add five-step PCM/CDM checkpoint 1000 and restore model card
Browse filesStudent adapter from qwen21-pcm8-cdm-original-targets-20260923, S3 checkpoint 0001000. Restore supplied README with five-step crossover sigma corrected to 0.94. Preserve both eight-step adapters.
- README.md +21 -9
- p_qwen_image_2.1_5step_v0.1.safetensors +3 -0
README.md
CHANGED
|
@@ -33,7 +33,7 @@ tags:
|
|
| 33 |
<h1 style="color: #9334E9;">β‘ Qwen-Image-2.1-P-Turbo</h1>
|
| 34 |
<h2>Few-step LoRA adapters for Qwen-Image-2.1</h2>
|
| 35 |
<h3>
|
| 36 |
-
<span style="color: #9334E9;">8 steps</span>
|
| 37 |
Β·
|
| 38 |
<span style="color: #9334E9;">No CFG</span>
|
| 39 |
Β·
|
|
@@ -43,8 +43,9 @@ tags:
|
|
| 43 |
|
| 44 |
**Qwen-Image-2.1-P-Turbo is a set of LoRA adapters that let
|
| 45 |
[`Qwen/Qwen-Image-2.1`](https://huggingface.co/Qwen/Qwen-Image-2.1) generate
|
| 46 |
-
and edit images in only 8 steps. The adapters load on top of the base
|
| 47 |
-
model, so the pipeline, text encoder and VAE stay unchanged.
|
|
|
|
| 48 |
|
| 49 |
> **v0.1: first release, work in progress.** P-Turbo does not yet match the
|
| 50 |
> visual quality of the base model. We are still improving the distillation and
|
|
@@ -52,12 +53,14 @@ model, so the pipeline, text encoder and VAE stay unchanged. Improved using Qwen
|
|
| 52 |
|
| 53 |
## Variants
|
| 54 |
|
| 55 |
-
|
| 56 |
|
| 57 |
-
| File | Steps |
|
| 58 |
|---|:---:|---|
|
| 59 |
-
| `p_qwen_image_2.1_8step_v0.1.safetensors` | 8 |
|
| 60 |
-
| `p_qwen_image_2.
|
|
|
|
|
|
|
| 61 |
|
| 62 |
## Quickstart
|
| 63 |
|
|
@@ -74,10 +77,13 @@ import torch
|
|
| 74 |
from PIL import Image
|
| 75 |
from diffusers import FlowMatchEulerDiscreteScheduler, QwenImage21Pipeline
|
| 76 |
|
| 77 |
-
STEPS = 8
|
| 78 |
|
| 79 |
# The terminal sigma 0 is appended by the scheduler.
|
| 80 |
-
SIGMAS =
|
|
|
|
|
|
|
|
|
|
| 81 |
|
| 82 |
pipe = QwenImage21Pipeline.from_pretrained(
|
| 83 |
"Qwen/Qwen-Image-2.1", torch_dtype=torch.bfloat16
|
|
@@ -132,6 +138,7 @@ image.save("edit_example.png")
|
|
| 132 |
at `shift=1.0` with dynamic shifting off so the sigmas are not shifted twice.
|
| 133 |
- 8-step: `1 β 14/15 β 6/7 β 10/13 β 2/3 β 6/11 β 0.4 β 2/9 β 0`
|
| 134 |
(shift 2, computed as `Ο = 2t / (1 + t)` on evenly spaced `t`)
|
|
|
|
| 135 |
- **No CFG.** Keep `true_cfg_scale=1.0` and do not pass a negative prompt.
|
| 136 |
- **Keep the LoRA strength at 1.0.**
|
| 137 |
- **Write detailed prompts for text-to-image.** Longer prompts that describe
|
|
@@ -141,7 +148,12 @@ image.save("edit_example.png")
|
|
| 141 |
## Limitations
|
| 142 |
|
| 143 |
- This is a first version. Quality is below that of the base model.
|
|
|
|
|
|
|
| 144 |
- Short or vague text-to-image prompts give weaker results.
|
|
|
|
|
|
|
|
|
|
| 145 |
- The adapters are only intended for the settings above. Other step counts,
|
| 146 |
schedules or CFG values are not supported.
|
| 147 |
|
|
|
|
| 33 |
<h1 style="color: #9334E9;">β‘ Qwen-Image-2.1-P-Turbo</h1>
|
| 34 |
<h2>Few-step LoRA adapters for Qwen-Image-2.1</h2>
|
| 35 |
<h3>
|
| 36 |
+
<span style="color: #9334E9;">5 or 8 steps</span>
|
| 37 |
Β·
|
| 38 |
<span style="color: #9334E9;">No CFG</span>
|
| 39 |
Β·
|
|
|
|
| 43 |
|
| 44 |
**Qwen-Image-2.1-P-Turbo is a set of LoRA adapters that let
|
| 45 |
[`Qwen/Qwen-Image-2.1`](https://huggingface.co/Qwen/Qwen-Image-2.1) generate
|
| 46 |
+
and edit images in only 5 or 8 steps. The adapters load on top of the base
|
| 47 |
+
model, so the pipeline, text encoder and VAE stay unchanged. Training is based
|
| 48 |
+
on DMD. Improved using Qwen.**
|
| 49 |
|
| 50 |
> **v0.1: first release, work in progress.** P-Turbo does not yet match the
|
| 51 |
> visual quality of the base model. We are still improving the distillation and
|
|
|
|
| 53 |
|
| 54 |
## Variants
|
| 55 |
|
| 56 |
+
Both adapters are v0.1. Pick one based on whether you need quality or speed.
|
| 57 |
|
| 58 |
+
| File | Steps | Trade-off |
|
| 59 |
|---|:---:|---|
|
| 60 |
+
| `p_qwen_image_2.1_8step_v0.1.safetensors` | 8 | **Higher quality.** Recommended as the default. |
|
| 61 |
+
| `p_qwen_image_2.1_5step_v0.1.safetensors` | 5 | **Higher speed**, with noticeably lower visual quality. |
|
| 62 |
+
|
| 63 |
+
Each adapter is trained for its own sigma schedule. Load only one at a time.
|
| 64 |
|
| 65 |
## Quickstart
|
| 66 |
|
|
|
|
| 77 |
from PIL import Image
|
| 78 |
from diffusers import FlowMatchEulerDiscreteScheduler, QwenImage21Pipeline
|
| 79 |
|
| 80 |
+
STEPS = 8 # 8 for higher quality, 5 for higher speed
|
| 81 |
|
| 82 |
# The terminal sigma 0 is appended by the scheduler.
|
| 83 |
+
SIGMAS = {
|
| 84 |
+
5: [1.0, 0.94, 6 / 7, 2 / 3, 0.4],
|
| 85 |
+
8: [1.0, 14 / 15, 6 / 7, 10 / 13, 2 / 3, 6 / 11, 0.4, 2 / 9],
|
| 86 |
+
}[STEPS]
|
| 87 |
|
| 88 |
pipe = QwenImage21Pipeline.from_pretrained(
|
| 89 |
"Qwen/Qwen-Image-2.1", torch_dtype=torch.bfloat16
|
|
|
|
| 138 |
at `shift=1.0` with dynamic shifting off so the sigmas are not shifted twice.
|
| 139 |
- 8-step: `1 β 14/15 β 6/7 β 10/13 β 2/3 β 6/11 β 0.4 β 2/9 β 0`
|
| 140 |
(shift 2, computed as `Ο = 2t / (1 + t)` on evenly spaced `t`)
|
| 141 |
+
- 5-step: `1 β 0.94 β 6/7 β 2/3 β 0.4 β 0`
|
| 142 |
- **No CFG.** Keep `true_cfg_scale=1.0` and do not pass a negative prompt.
|
| 143 |
- **Keep the LoRA strength at 1.0.**
|
| 144 |
- **Write detailed prompts for text-to-image.** Longer prompts that describe
|
|
|
|
| 148 |
## Limitations
|
| 149 |
|
| 150 |
- This is a first version. Quality is below that of the base model.
|
| 151 |
+
- The 5-step adapter is faster than the 8-step one, but its images are
|
| 152 |
+
visibly worse.
|
| 153 |
- Short or vague text-to-image prompts give weaker results.
|
| 154 |
+
- Trained only at 1K resolution (around 1024 Γ 1024 pixels). Other resolutions
|
| 155 |
+
may give worse results. The next version will also be trained at higher
|
| 156 |
+
resolutions.
|
| 157 |
- The adapters are only intended for the settings above. Other step counts,
|
| 158 |
schedules or CFG values are not supported.
|
| 159 |
|
p_qwen_image_2.1_5step_v0.1.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:284cdf6f18983a89035016a39c8b5b74f71edd46b2af46ba801b093e3b09be2b
|
| 3 |
+
size 335606144
|