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
fix: full renaming
Browse files- .gitattributes +5 -6
- README.md +16 -16
- assets/{Pruna-Q-Image-2.1-i2i-1024.png → P-Q-Image-2.1-end-to-end.png} +2 -2
- assets/{Pruna-Q-Image-2.1-i2i-2048.png → P-Q-Image-2.1-i2i-1024-all.png} +2 -2
- assets/{Pruna-Q-Image-2.1-t2i-1024.png → P-Q-Image-2.1-i2i-1024-v02.png} +2 -2
- assets/{Pruna-Q-Image-2.1-t2i-2048.png → P-Q-Image-2.1-i2i-1024.png} +2 -2
- assets/P-Q-Image-2.1-i2i-2048-all.png +3 -0
- assets/P-Q-Image-2.1-i2i-2048-v02.png +3 -0
- assets/P-Q-Image-2.1-i2i-2048.png +3 -0
- assets/{Pruna-Q-Image-2.1-prompt-upsampling.png → P-Q-Image-2.1-prompt-upsampling.png} +0 -0
- assets/P-Q-Image-2.1-t2i-1024-all.png +3 -0
- assets/P-Q-Image-2.1-t2i-1024-v02.png +3 -0
- assets/P-Q-Image-2.1-t2i-1024.png +3 -0
- assets/P-Q-Image-2.1-t2i-2048-all.png +3 -0
- assets/P-Q-Image-2.1-t2i-2048-v02.png +3 -0
- assets/P-Q-Image-2.1-t2i-2048.png +3 -0
- assets/{Pruna-Q-Image-2.1-v02-generation.png → P-Q-Image-2.1-v02-generation.png} +0 -0
- assets/P-Q-Image-2.1.png +3 -0
- assets/Pruna-Q-Image-2.1.png +0 -3
.gitattributes
CHANGED
|
@@ -36,10 +36,9 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 36 |
assets/latency_t2i_1k_2k.png filter=lfs diff=lfs merge=lfs -text
|
| 37 |
assets/download-1.png filter=lfs diff=lfs merge=lfs -text
|
| 38 |
assets/edit_grid.jpg filter=lfs diff=lfs merge=lfs -text
|
| 39 |
-
assets/
|
| 40 |
-
assets/
|
| 41 |
-
assets/
|
| 42 |
-
assets/
|
| 43 |
-
assets/
|
| 44 |
assets/*.png filter=lfs diff=lfs merge=lfs -text
|
| 45 |
-
assets/Pruna-Qwen-Image-2.1.png filter=lfs diff=lfs merge=lfs -text
|
|
|
|
| 36 |
assets/latency_t2i_1k_2k.png filter=lfs diff=lfs merge=lfs -text
|
| 37 |
assets/download-1.png filter=lfs diff=lfs merge=lfs -text
|
| 38 |
assets/edit_grid.jpg filter=lfs diff=lfs merge=lfs -text
|
| 39 |
+
assets/P-Q-Image-2.1-i2i-1024.png filter=lfs diff=lfs merge=lfs -text
|
| 40 |
+
assets/P-Q-Image-2.1-i2i-2048.png filter=lfs diff=lfs merge=lfs -text
|
| 41 |
+
assets/P-Q-Image-2.1-t2i-1024.png filter=lfs diff=lfs merge=lfs -text
|
| 42 |
+
assets/P-Q-Image-2.1-t2i-2048.png filter=lfs diff=lfs merge=lfs -text
|
| 43 |
+
assets/P-Q-Image-2.1.png filter=lfs diff=lfs merge=lfs -text
|
| 44 |
assets/*.png filter=lfs diff=lfs merge=lfs -text
|
|
|
README.md
CHANGED
|
@@ -16,7 +16,7 @@ tags:
|
|
| 16 |
<!-- header start -->
|
| 17 |
<!-- 200823 -->
|
| 18 |
<p align="center">
|
| 19 |
-
<img src="assets/
|
| 20 |
</p>
|
| 21 |
<!-- header end -->
|
| 22 |
|
|
@@ -43,7 +43,7 @@ tags:
|
|
| 43 |
</p>
|
| 44 |
<div align="center">
|
| 45 |
|
| 46 |
-
<h1 style="color: #9334E9;">⚡
|
| 47 |
|
| 48 |
<h2>Few-step LoRA adapters for Qwen-Image-2.1</h2>
|
| 49 |
|
|
@@ -59,7 +59,7 @@ tags:
|
|
| 59 |
|
| 60 |
</div>
|
| 61 |
|
| 62 |
-
**
|
| 63 |
[`Qwen/Qwen-Image-2.1`](https://huggingface.co/Qwen/Qwen-Image-2.1) generate
|
| 64 |
and edit images in only 6 steps (v0.2), or 5 or 8 steps (v0.1). The adapters load on top of the base
|
| 65 |
model, so the pipeline, text encoder, and VAE stay unchanged.
|
|
@@ -156,7 +156,7 @@ pipe = QwenImage21Pipeline.from_pretrained(
|
|
| 156 |
"Qwen/Qwen-Image-2.1", torch_dtype=torch.bfloat16
|
| 157 |
).to("cuda")
|
| 158 |
pipe.load_lora_weights(
|
| 159 |
-
"PrunaAI/
|
| 160 |
weight_name=WEIGHT_NAME,
|
| 161 |
)
|
| 162 |
|
|
@@ -171,7 +171,7 @@ pipe.scheduler = FlowMatchEulerDiscreteScheduler.from_config(
|
|
| 171 |
Both variants load on **`Qwen/Qwen-Image-2.1`** using **`QwenImage21Pipeline`**.
|
| 172 |
Choose one LoRA with `VARIANT`; the `6-steps-upsampled` variant runs directly on your
|
| 173 |
original prompt without a separate prompt-enhancer model. For a local export,
|
| 174 |
-
replace `"PrunaAI/
|
| 175 |
safetensors file and keep `weight_name=WEIGHT_NAME`.
|
| 176 |
|
| 177 |
Both files have **rank 64** across **232 linear targets**, including `proj_out`.
|
|
@@ -201,7 +201,7 @@ pipe = QwenImage21Pipeline.from_pretrained(
|
|
| 201 |
"Qwen/Qwen-Image-2.1", torch_dtype=torch.bfloat16
|
| 202 |
).to("cuda")
|
| 203 |
pipe.load_lora_weights(
|
| 204 |
-
"PrunaAI/
|
| 205 |
weight_name=f"p_q_image_2.1_{STEPS}_steps_v0.1.safetensors",
|
| 206 |
)
|
| 207 |
|
|
@@ -222,12 +222,12 @@ pipe.scheduler = FlowMatchEulerDiscreteScheduler.from_config(
|
|
| 222 |
<table>
|
| 223 |
<tr>
|
| 224 |
<td>
|
| 225 |
-
<img src="assets/
|
| 226 |
</td>
|
| 227 |
</tr>
|
| 228 |
<tr>
|
| 229 |
<td>
|
| 230 |
-
<img src="assets/
|
| 231 |
</td>
|
| 232 |
</tr>
|
| 233 |
</table>
|
|
@@ -265,18 +265,18 @@ Both enhancers use thinking with
|
|
| 265 |
<table>
|
| 266 |
<tr>
|
| 267 |
<td width="50%">
|
| 268 |
-
<img src="assets/
|
| 269 |
</td>
|
| 270 |
<td width="50%">
|
| 271 |
-
<img src="assets/
|
| 272 |
</td>
|
| 273 |
</tr>
|
| 274 |
<tr>
|
| 275 |
<td width="50%">
|
| 276 |
-
<img src="assets/
|
| 277 |
</td>
|
| 278 |
<td width="50%">
|
| 279 |
-
<img src="assets/
|
| 280 |
</td>
|
| 281 |
</tr>
|
| 282 |
</table>
|
|
@@ -284,9 +284,9 @@ Both enhancers use thinking with
|
|
| 284 |
Text-to-image with the official Qwen model-card example prompt, BF16, batch size 1,
|
| 285 |
on one NVIDIA H100 80GB. Median of 3 requests after one warmup per configuration.
|
| 286 |
Includes prompt encoding, denoising, and decoding; excludes PNG saving, model
|
| 287 |
-
loading, and warmup. Base: 40 steps with KV cache on;
|
| 288 |
KV cache off, as configured for this benchmark. The examples below enable KV caching for
|
| 289 |
-
|
| 290 |
no CFG, compilation, or CPU offload. These timings do not imply equal image quality.
|
| 291 |
|
| 292 |
|
|
@@ -384,7 +384,7 @@ and `shift_terminal=None`, as shown in the v0.2 setup.
|
|
| 384 |
|
| 385 |
The end distilled model is based on Qwen-Image-2.1.
|
| 386 |
|
| 387 |
-
|
| 388 |
under the **Qwen RESEARCH LICENSE AGREEMENT**. Review its use restrictions
|
| 389 |
before using or redistributing the adapters.
|
| 390 |
|
|
@@ -393,7 +393,7 @@ Hangzhou Tongyi Laboratory Technology Co., Ltd. All Rights Reserved.
|
|
| 393 |
|
| 394 |
## What's next?
|
| 395 |
|
| 396 |
-
- **Use
|
| 397 |
- Compress your own models with [Pruna](https://github.com/PrunaAI/pruna) and give us a ⭐️ for more efficiency!
|
| 398 |
- Want to use our optimized image models right away? Check [P-Image-Ideogram](https://www.pruna.ai/p-image-ideogram) and [P-Image-Edit](https://www.pruna.ai/p-image-edit).
|
| 399 |
|
|
|
|
| 16 |
<!-- header start -->
|
| 17 |
<!-- 200823 -->
|
| 18 |
<p align="center">
|
| 19 |
+
<img src="assets/P-Q-Image-2.1.png" width="800">
|
| 20 |
</p>
|
| 21 |
<!-- header end -->
|
| 22 |
|
|
|
|
| 43 |
</p>
|
| 44 |
<div align="center">
|
| 45 |
|
| 46 |
+
<h1 style="color: #9334E9;">⚡ P-Q-Image-2.1</h1>
|
| 47 |
|
| 48 |
<h2>Few-step LoRA adapters for Qwen-Image-2.1</h2>
|
| 49 |
|
|
|
|
| 59 |
|
| 60 |
</div>
|
| 61 |
|
| 62 |
+
**P-Q-Image-2.1** is a set of LoRA adapters that let
|
| 63 |
[`Qwen/Qwen-Image-2.1`](https://huggingface.co/Qwen/Qwen-Image-2.1) generate
|
| 64 |
and edit images in only 6 steps (v0.2), or 5 or 8 steps (v0.1). The adapters load on top of the base
|
| 65 |
model, so the pipeline, text encoder, and VAE stay unchanged.
|
|
|
|
| 156 |
"Qwen/Qwen-Image-2.1", torch_dtype=torch.bfloat16
|
| 157 |
).to("cuda")
|
| 158 |
pipe.load_lora_weights(
|
| 159 |
+
"PrunaAI/P-Q-Image-2.1",
|
| 160 |
weight_name=WEIGHT_NAME,
|
| 161 |
)
|
| 162 |
|
|
|
|
| 171 |
Both variants load on **`Qwen/Qwen-Image-2.1`** using **`QwenImage21Pipeline`**.
|
| 172 |
Choose one LoRA with `VARIANT`; the `6-steps-upsampled` variant runs directly on your
|
| 173 |
original prompt without a separate prompt-enhancer model. For a local export,
|
| 174 |
+
replace `"PrunaAI/P-Q-Image-2.1"` with the folder containing the chosen
|
| 175 |
safetensors file and keep `weight_name=WEIGHT_NAME`.
|
| 176 |
|
| 177 |
Both files have **rank 64** across **232 linear targets**, including `proj_out`.
|
|
|
|
| 201 |
"Qwen/Qwen-Image-2.1", torch_dtype=torch.bfloat16
|
| 202 |
).to("cuda")
|
| 203 |
pipe.load_lora_weights(
|
| 204 |
+
"PrunaAI/P-Q-Image-2.1",
|
| 205 |
weight_name=f"p_q_image_2.1_{STEPS}_steps_v0.1.safetensors",
|
| 206 |
)
|
| 207 |
|
|
|
|
| 222 |
<table>
|
| 223 |
<tr>
|
| 224 |
<td>
|
| 225 |
+
<img src="assets/P-Q-Image-2.1-v02-generation.png" alt="Six-step generation latency at 1024 and 2048 pixels" width="100%">
|
| 226 |
</td>
|
| 227 |
</tr>
|
| 228 |
<tr>
|
| 229 |
<td>
|
| 230 |
+
<img src="assets/P-Q-Image-2.1-prompt-upsampling.png" alt="Prompt-upsampling latency for text and one to three reference images" width="100%">
|
| 231 |
</td>
|
| 232 |
</tr>
|
| 233 |
</table>
|
|
|
|
| 265 |
<table>
|
| 266 |
<tr>
|
| 267 |
<td width="50%">
|
| 268 |
+
<img src="assets/P-Q-Image-2.1-t2i-1024.png" width="100%">
|
| 269 |
</td>
|
| 270 |
<td width="50%">
|
| 271 |
+
<img src="assets/P-Q-Image-2.1-t2i-2048.png" width="100%">
|
| 272 |
</td>
|
| 273 |
</tr>
|
| 274 |
<tr>
|
| 275 |
<td width="50%">
|
| 276 |
+
<img src="assets/P-Q-Image-2.1-i2i-1024.png" width="100%">
|
| 277 |
</td>
|
| 278 |
<td width="50%">
|
| 279 |
+
<img src="assets/P-Q-Image-2.1-i2i-2048.png" width="100%">
|
| 280 |
</td>
|
| 281 |
</tr>
|
| 282 |
</table>
|
|
|
|
| 284 |
Text-to-image with the official Qwen model-card example prompt, BF16, batch size 1,
|
| 285 |
on one NVIDIA H100 80GB. Median of 3 requests after one warmup per configuration.
|
| 286 |
Includes prompt encoding, denoising, and decoding; excludes PNG saving, model
|
| 287 |
+
loading, and warmup. Base: 40 steps with KV cache on; P-Q-Image-2.1: 5 or 8 steps with
|
| 288 |
KV cache off, as configured for this benchmark. The examples below enable KV caching for
|
| 289 |
+
P-Q-Image-2.1; the chart has not been remeasured with that setting. LoRAs were unmerged;
|
| 290 |
no CFG, compilation, or CPU offload. These timings do not imply equal image quality.
|
| 291 |
|
| 292 |
|
|
|
|
| 384 |
|
| 385 |
The end distilled model is based on Qwen-Image-2.1.
|
| 386 |
|
| 387 |
+
P-Q-Image-2.1 is a derivative of Qwen-Image-2.1 and is distributed
|
| 388 |
under the **Qwen RESEARCH LICENSE AGREEMENT**. Review its use restrictions
|
| 389 |
before using or redistributing the adapters.
|
| 390 |
|
|
|
|
| 393 |
|
| 394 |
## What's next?
|
| 395 |
|
| 396 |
+
- **Use P-Q-Image-2.1 to generate and edit images with Qwen-Image-2.1 in a few steps.**
|
| 397 |
- Compress your own models with [Pruna](https://github.com/PrunaAI/pruna) and give us a ⭐️ for more efficiency!
|
| 398 |
- Want to use our optimized image models right away? Check [P-Image-Ideogram](https://www.pruna.ai/p-image-ideogram) and [P-Image-Edit](https://www.pruna.ai/p-image-edit).
|
| 399 |
|
assets/{Pruna-Q-Image-2.1-i2i-1024.png → P-Q-Image-2.1-end-to-end.png}
RENAMED
|
File without changes
|
assets/{Pruna-Q-Image-2.1-i2i-2048.png → P-Q-Image-2.1-i2i-1024-all.png}
RENAMED
|
File without changes
|
assets/{Pruna-Q-Image-2.1-t2i-1024.png → P-Q-Image-2.1-i2i-1024-v02.png}
RENAMED
|
File without changes
|
assets/{Pruna-Q-Image-2.1-t2i-2048.png → P-Q-Image-2.1-i2i-1024.png}
RENAMED
|
File without changes
|
assets/P-Q-Image-2.1-i2i-2048-all.png
ADDED
|
Git LFS Details
|
assets/P-Q-Image-2.1-i2i-2048-v02.png
ADDED
|
Git LFS Details
|
assets/P-Q-Image-2.1-i2i-2048.png
ADDED
|
Git LFS Details
|
assets/{Pruna-Q-Image-2.1-prompt-upsampling.png → P-Q-Image-2.1-prompt-upsampling.png}
RENAMED
|
File without changes
|
assets/P-Q-Image-2.1-t2i-1024-all.png
ADDED
|
Git LFS Details
|
assets/P-Q-Image-2.1-t2i-1024-v02.png
ADDED
|
Git LFS Details
|
assets/P-Q-Image-2.1-t2i-1024.png
ADDED
|
Git LFS Details
|
assets/P-Q-Image-2.1-t2i-2048-all.png
ADDED
|
Git LFS Details
|
assets/P-Q-Image-2.1-t2i-2048-v02.png
ADDED
|
Git LFS Details
|
assets/P-Q-Image-2.1-t2i-2048.png
ADDED
|
Git LFS Details
|
assets/{Pruna-Q-Image-2.1-v02-generation.png → P-Q-Image-2.1-v02-generation.png}
RENAMED
|
File without changes
|
assets/P-Q-Image-2.1.png
ADDED
|
Git LFS Details
|
assets/Pruna-Q-Image-2.1.png
DELETED
Git LFS Details
|