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
fix/update-repo (#8)
Browse files- update README and assets (98a03292f655355c9e6ede1527046aab9605f4b2)
- update safetensors name (f6a031935768722725a355159b1f13667e296c55)
- update banner image (55b9a255b8230673b9015f2eb64abc4e5faee2e2)
- .gitattributes +5 -5
- README.md +16 -16
- assets/{Pruna-Qwen-Image-2.1-i2i-1024.png → Pruna-Q-Image-2.1-i2i-1024.png} +0 -0
- assets/{Pruna-Qwen-Image-2.1-i2i-2048.png → Pruna-Q-Image-2.1-i2i-2048.png} +0 -0
- assets/{Pruna-Qwen-Image-2.1-t2i-1024.png → Pruna-Q-Image-2.1-t2i-1024.png} +0 -0
- assets/{Pruna-Qwen-Image-2.1-t2i-2048.png → Pruna-Q-Image-2.1-t2i-2048.png} +0 -0
- assets/{Pruna-Qwen-Image-2.1.png → Pruna-Q-Image-2.1.png} +2 -2
- p_qwen_image_2.1_5step_v0.1.safetensors → p_q_image_2.1_5step_v0.1.safetensors +0 -0
- p_qwen_image_2.1_8step_v0.1.safetensors → p_q_image_2.1_8step_v0.1.safetensors +0 -0
.gitattributes
CHANGED
|
@@ -36,8 +36,8 @@ 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/Pruna-
|
| 40 |
-
assets/Pruna-
|
| 41 |
-
assets/Pruna-
|
| 42 |
-
assets/Pruna-
|
| 43 |
-
assets/Pruna-
|
|
|
|
| 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/Pruna-Q-Image-2.1-i2i-1024.png filter=lfs diff=lfs merge=lfs -text
|
| 40 |
+
assets/Pruna-Q-Image-2.1-i2i-2048.png filter=lfs diff=lfs merge=lfs -text
|
| 41 |
+
assets/Pruna-Q-Image-2.1-t2i-1024.png filter=lfs diff=lfs merge=lfs -text
|
| 42 |
+
assets/Pruna-Q-Image-2.1-t2i-2048.png filter=lfs diff=lfs merge=lfs -text
|
| 43 |
+
assets/Pruna-Q-Image-2.1.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/Pruna-
|
| 20 |
</p>
|
| 21 |
<!-- header end -->
|
| 22 |
|
|
@@ -43,7 +43,7 @@ tags:
|
|
| 43 |
</p>
|
| 44 |
<div align="center">
|
| 45 |
|
| 46 |
-
<h1 style="color: #9334E9;">⚡ Pruna-
|
| 47 |
|
| 48 |
<h2>Few-step LoRA adapters for Qwen-Image-2.1</h2>
|
| 49 |
|
|
@@ -59,13 +59,13 @@ tags:
|
|
| 59 |
|
| 60 |
</div>
|
| 61 |
|
| 62 |
-
**Pruna-
|
| 63 |
[`Qwen/Qwen-Image-2.1`](https://huggingface.co/Qwen/Qwen-Image-2.1) generate
|
| 64 |
and edit images in only 5 or 8 steps. The adapters load on top of the base
|
| 65 |
model, so the pipeline, text encoder, and VAE stay unchanged. Training is based
|
| 66 |
on DMD. Improved using Qwen.**
|
| 67 |
|
| 68 |
-
> **v0.1: first release, work in progress.** Pruna-
|
| 69 |
> visual quality of the base model. We are still improving the distillation and
|
| 70 |
> will update this repository as new versions become available.
|
| 71 |
|
|
@@ -75,8 +75,8 @@ Both adapters are v0.1. Pick one based on whether you need **quality** or **spee
|
|
| 75 |
|
| 76 |
| File | Steps | Trade-off |
|
| 77 |
|---|:---:|---|
|
| 78 |
-
| `
|
| 79 |
-
| `
|
| 80 |
|
| 81 |
Each adapter is trained for its own sigma schedule. Load only one at a time.
|
| 82 |
|
|
@@ -99,18 +99,18 @@ Use a table; Hugging Face can otherwise render the `<img>` elements as separate
|
|
| 99 |
<table>
|
| 100 |
<tr>
|
| 101 |
<td width="50%">
|
| 102 |
-
<img src="assets/Pruna-
|
| 103 |
</td>
|
| 104 |
<td width="50%">
|
| 105 |
-
<img src="assets/Pruna-
|
| 106 |
</td>
|
| 107 |
</tr>
|
| 108 |
<tr>
|
| 109 |
<td width="50%">
|
| 110 |
-
<img src="assets/Pruna-
|
| 111 |
</td>
|
| 112 |
<td width="50%">
|
| 113 |
-
<img src="assets/Pruna-
|
| 114 |
</td>
|
| 115 |
</tr>
|
| 116 |
</table>
|
|
@@ -118,9 +118,9 @@ Use a table; Hugging Face can otherwise render the `<img>` elements as separate
|
|
| 118 |
Text-to-image with the official Qwen model-card example prompt, BF16, batch size 1,
|
| 119 |
on one NVIDIA H100 80GB. Median of 3 requests after one warmup per configuration.
|
| 120 |
Includes prompt encoding, denoising, and decoding; excludes PNG saving, model
|
| 121 |
-
loading, and warmup. Base: 40 steps with KV cache on; Pruna-
|
| 122 |
KV cache off, as configured for this benchmark. The examples below enable KV caching for
|
| 123 |
-
Pruna-
|
| 124 |
no CFG, compilation, or CPU offload. These timings do not imply equal image quality.
|
| 125 |
|
| 126 |
## Quickstart
|
|
@@ -149,8 +149,8 @@ pipe = QwenImage21Pipeline.from_pretrained(
|
|
| 149 |
"Qwen/Qwen-Image-2.1", torch_dtype=torch.bfloat16
|
| 150 |
).to("cuda")
|
| 151 |
pipe.load_lora_weights(
|
| 152 |
-
"PrunaAI/Pruna-
|
| 153 |
-
weight_name=f"
|
| 154 |
)
|
| 155 |
|
| 156 |
# Use the sigmas exactly as given: no extra shifting.
|
|
@@ -229,7 +229,7 @@ image = pipe(
|
|
| 229 |
|
| 230 |
The end distilled model is based on Qwen-Image-2.1.
|
| 231 |
|
| 232 |
-
Pruna-
|
| 233 |
under the **Qwen RESEARCH LICENSE AGREEMENT**. Review its use restrictions
|
| 234 |
before using or redistributing the adapters.
|
| 235 |
|
|
@@ -238,7 +238,7 @@ Hangzhou Tongyi Laboratory Technology Co., Ltd. All Rights Reserved.
|
|
| 238 |
|
| 239 |
## What's next?
|
| 240 |
|
| 241 |
-
- **Use Pruna-
|
| 242 |
- Compress your own models with [Pruna](https://github.com/PrunaAI/pruna) and give us a ⭐️ for more efficiency!
|
| 243 |
- 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).
|
| 244 |
|
|
|
|
| 16 |
<!-- header start -->
|
| 17 |
<!-- 200823 -->
|
| 18 |
<p align="center">
|
| 19 |
+
<img src="assets/Pruna-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;">⚡ Pruna-Q-Image-2.1</h1>
|
| 47 |
|
| 48 |
<h2>Few-step LoRA adapters for Qwen-Image-2.1</h2>
|
| 49 |
|
|
|
|
| 59 |
|
| 60 |
</div>
|
| 61 |
|
| 62 |
+
**Pruna-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 5 or 8 steps. The adapters load on top of the base
|
| 65 |
model, so the pipeline, text encoder, and VAE stay unchanged. Training is based
|
| 66 |
on DMD. Improved using Qwen.**
|
| 67 |
|
| 68 |
+
> **v0.1: first release, work in progress.** Pruna-Q-Image-2.1 does not yet match the
|
| 69 |
> visual quality of the base model. We are still improving the distillation and
|
| 70 |
> will update this repository as new versions become available.
|
| 71 |
|
|
|
|
| 75 |
|
| 76 |
| File | Steps | Trade-off |
|
| 77 |
|---|:---:|---|
|
| 78 |
+
| `p_q_image_2.1_8step_v0.1.safetensors` | 8 | **Higher quality.** Recommended as the default. |
|
| 79 |
+
| `p_q_image_2.1_5step_v0.1.safetensors` | 5 | **Higher speed**, with noticeably lower visual quality. |
|
| 80 |
|
| 81 |
Each adapter is trained for its own sigma schedule. Load only one at a time.
|
| 82 |
|
|
|
|
| 99 |
<table>
|
| 100 |
<tr>
|
| 101 |
<td width="50%">
|
| 102 |
+
<img src="assets/Pruna-Q-Image-2.1-t2i-1024.png" width="100%">
|
| 103 |
</td>
|
| 104 |
<td width="50%">
|
| 105 |
+
<img src="assets/Pruna-Q-Image-2.1-t2i-2048.png" width="100%">
|
| 106 |
</td>
|
| 107 |
</tr>
|
| 108 |
<tr>
|
| 109 |
<td width="50%">
|
| 110 |
+
<img src="assets/Pruna-Q-Image-2.1-i2i-1024.png" width="100%">
|
| 111 |
</td>
|
| 112 |
<td width="50%">
|
| 113 |
+
<img src="assets/Pruna-Q-Image-2.1-i2i-2048.png" width="100%">
|
| 114 |
</td>
|
| 115 |
</tr>
|
| 116 |
</table>
|
|
|
|
| 118 |
Text-to-image with the official Qwen model-card example prompt, BF16, batch size 1,
|
| 119 |
on one NVIDIA H100 80GB. Median of 3 requests after one warmup per configuration.
|
| 120 |
Includes prompt encoding, denoising, and decoding; excludes PNG saving, model
|
| 121 |
+
loading, and warmup. Base: 40 steps with KV cache on; Pruna-Q-Image-2.1: 5 or 8 steps with
|
| 122 |
KV cache off, as configured for this benchmark. The examples below enable KV caching for
|
| 123 |
+
Pruna-Q-Image-2.1; the chart has not been remeasured with that setting. LoRAs were unmerged;
|
| 124 |
no CFG, compilation, or CPU offload. These timings do not imply equal image quality.
|
| 125 |
|
| 126 |
## Quickstart
|
|
|
|
| 149 |
"Qwen/Qwen-Image-2.1", torch_dtype=torch.bfloat16
|
| 150 |
).to("cuda")
|
| 151 |
pipe.load_lora_weights(
|
| 152 |
+
"PrunaAI/Pruna-Q-Image-2.1",
|
| 153 |
+
weight_name=f"p_q_image_2.1_{STEPS}step_v0.1.safetensors",
|
| 154 |
)
|
| 155 |
|
| 156 |
# Use the sigmas exactly as given: no extra shifting.
|
|
|
|
| 229 |
|
| 230 |
The end distilled model is based on Qwen-Image-2.1.
|
| 231 |
|
| 232 |
+
Pruna-Q-Image-2.1 is a derivative of Qwen-Image-2.1 and is distributed
|
| 233 |
under the **Qwen RESEARCH LICENSE AGREEMENT**. Review its use restrictions
|
| 234 |
before using or redistributing the adapters.
|
| 235 |
|
|
|
|
| 238 |
|
| 239 |
## What's next?
|
| 240 |
|
| 241 |
+
- **Use Pruna-Q-Image-2.1 to generate and edit images with Qwen-Image-2.1 in a few steps.**
|
| 242 |
- Compress your own models with [Pruna](https://github.com/PrunaAI/pruna) and give us a ⭐️ for more efficiency!
|
| 243 |
- 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).
|
| 244 |
|
assets/{Pruna-Qwen-Image-2.1-i2i-1024.png → Pruna-Q-Image-2.1-i2i-1024.png}
RENAMED
|
File without changes
|
assets/{Pruna-Qwen-Image-2.1-i2i-2048.png → Pruna-Q-Image-2.1-i2i-2048.png}
RENAMED
|
File without changes
|
assets/{Pruna-Qwen-Image-2.1-t2i-1024.png → Pruna-Q-Image-2.1-t2i-1024.png}
RENAMED
|
File without changes
|
assets/{Pruna-Qwen-Image-2.1-t2i-2048.png → Pruna-Q-Image-2.1-t2i-2048.png}
RENAMED
|
File without changes
|
assets/{Pruna-Qwen-Image-2.1.png → Pruna-Q-Image-2.1.png}
RENAMED
|
File without changes
|
p_qwen_image_2.1_5step_v0.1.safetensors → p_q_image_2.1_5step_v0.1.safetensors
RENAMED
|
File without changes
|
p_qwen_image_2.1_8step_v0.1.safetensors → p_q_image_2.1_8step_v0.1.safetensors
RENAMED
|
File without changes
|