Skip to content

Commit 955b552

Browse files
authored
fix: qwen-image-edit-2509 docs and examples (#731)
* fix: add missing scheduler to qwen-image-edit-2509 lightning example * docs: add documentation for qwen-image-edit-2509 lightning * docs: add Distilled Qwen-Image-Edit-2509-Lightning section and fix Hugging Face link refs - Add a new "Distilled Qwen-Image-Edit-2509 (Qwen-Image-Edit-2509-Lightning)" section to docs/source/usage/qwen-image-edit.rst, referencing examples/v1/qwen-image-edit-2509-lightning.py. - Fix incorrect reStructuredText named-reference syntax that produced relative links: changed occurrences like <hf_qwen-image>/<hf_qwen-image-edit>/<hf_qwen-image-lightning> to the correct named-reference form with trailing underscore (e.g. <hf_qwen-image_>). This makes those links resolve to the external URLs defined in docs/source/links/huggingface.txt instead of becoming relative links. - Files modified: - docs/source/usage/qwen-image-edit.rst - docs/source/usage/qwen-image.rst * style: make linter happy * fix the repo
1 parent 06a989f commit 955b552

3 files changed

Lines changed: 20 additions & 9 deletions

File tree

docs/source/usage/qwen-image-edit.rst

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ Qwen-Image-Edit
44
Original Qwen-Image-Edit
55
------------------------
66

7-
`Qwen-Image-Edit <hf_qwen-image-edit>`_ is the image editing version of Qwen-Image.
8-
Below is a minimal example for running the 4-bit quantized `Qwen-Image-Edit <hf_qwen-image-edit>`_ model with Nunchaku.
7+
`Qwen-Image-Edit <hf_qwen-image-edit_>`_ is the image editing version of Qwen-Image.
8+
Below is a minimal example for running the 4-bit quantized `Qwen-Image-Edit <hf_qwen-image-edit_>`_ model with Nunchaku.
99
Nunchaku offers an API compatible with `Diffusers <github_diffusers_>`_, allowing for a familiar user experience.
1010

1111
.. literalinclude:: ../../../examples/v1/qwen-image-edit.py
@@ -26,7 +26,7 @@ The :meth:`~nunchaku.models.transformers.transformer_qwenimage.NunchakuQwenImage
2626
Distilled Qwen-Image-Edit (Qwen-Image-Lightning)
2727
------------------------------------------------
2828

29-
For faster inference, we provide pre-quantized 4-step and 8-step Qwen-Image-Edit models by integrating `Qwen-Image-Lightning LoRAs <hf_qwen-image-lightning>`_.
29+
For faster inference, we provide pre-quantized 4-step and 8-step Qwen-Image-Edit models by integrating `Qwen-Image-Lightning LoRAs <hf_qwen-image-lightning_>`_.
3030
See the example script below:
3131

3232
.. literalinclude:: ../../../examples/v1/qwen-image-edit-lightning.py
@@ -41,7 +41,7 @@ Qwen-Image-Edit-2509
4141
:alt: Nunchaku-Qwen-Image-Edit-2509
4242

4343
Qwen-Image-Edit-2509 is an monthly iteration of Qwen-Image-Edit.
44-
Below is a minimal example for running the 4-bit quantized `Qwen-Image-Edit-2509 <hf_qwen-image-edit-2509>`_ model with Nunchaku.
44+
Below is a minimal example for running the 4-bit quantized `Qwen-Image-Edit-2509 <hf_qwen-image-edit-2509_>`_ model with Nunchaku.
4545

4646
.. literalinclude:: ../../../examples/v1/qwen-image-edit-2509.py
4747
:language: python
@@ -52,3 +52,14 @@ Below is a minimal example for running the 4-bit quantized `Qwen-Image-Edit-2509
5252
This example requires ``diffusers`` version 0.36.0 or higher.
5353

5454
Custom LoRA support is under development.
55+
56+
Distilled Qwen-Image-Edit-2509 (Qwen-Image-Edit-2509-Lightning)
57+
---------------------------------------------------------------
58+
59+
For faster inference of the 2509 branch, we provide pre-quantized Lightning variants by integrating `Qwen-Image-Lightning LoRAs <hf_qwen-image-lightning_>`_.
60+
See the example script below:
61+
62+
.. literalinclude:: ../../../examples/v1/qwen-image-edit-2509-lightning.py
63+
:language: python
64+
:caption: Running Qwen-Image-Edit-2509-Lightning (`examples/v1/qwen-image-edit-2509-lightning.py <https://github.com/nunchaku-tech/nunchaku/blob/main/examples/v1/qwen-image-edit-2509-lightning.py>`__)
65+
:linenos:

docs/source/usage/qwen-image.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ Original Qwen-Image
77
.. image:: https://huggingface.co/datasets/nunchaku-tech/cdn/resolve/main/nunchaku/assets/qwen-image.jpg
88
:alt: Qwen-Image with Nunchaku
99

10-
`Qwen-Image <hf_qwen-image>`_ is an image generation foundation model in the Qwen series that achieves significant advances in complex text rendering.
11-
Below is a minimal example for running the 4-bit quantized `Qwen-Image <hf_qwen-image>`_ model with Nunchaku.
10+
`Qwen-Image <hf_qwen-image_>`_ is an image generation foundation model in the Qwen series that achieves significant advances in complex text rendering.
11+
Below is a minimal example for running the 4-bit quantized `Qwen-Image <hf_qwen-image_>`_ model with Nunchaku.
1212
Nunchaku offers an API compatible with `Diffusers <github_diffusers_>`_, allowing for a familiar user experience.
1313

1414
.. literalinclude:: ../../../examples/v1/qwen-image.py
@@ -29,7 +29,7 @@ The :meth:`~nunchaku.models.transformers.transformer_qwenimage.NunchakuQwenImage
2929
Distilled Qwen-Image (Qwen-Image-Lightning)
3030
-------------------------------------------
3131

32-
For faster inference, we provide pre-quantized 4-step and 8-step Qwen-Image models by integrating `Qwen-Image-Lightning LoRAs <hf_qwen-image-lightning>`_.
32+
For faster inference, we provide pre-quantized 4-step and 8-step Qwen-Image models by integrating `Qwen-Image-Lightning LoRAs <hf_qwen-image-lightning_>`_.
3333
See the example script below:
3434

3535
.. literalinclude:: ../../../examples/v1/qwen-image-lightning.py

examples/v1/qwen-image-edit-2509-lightning.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@
2828

2929
num_inference_steps = 4 # you can also use the 8-step model to improve the quality
3030
rank = 32 # you can also use the rank=128 model to improve the quality
31-
model_path = f"nunchaku-tech/nunchaku-qwen-image-edit-2509-lightning/svdq-{get_precision()}_r{rank}-qwen-image-edit-2509-lightningv2.0-{num_inference_steps}steps.safetensors"
31+
model_path = f"nunchaku-tech/nunchaku-qwen-image-edit-2509/svdq-{get_precision()}_r{rank}-qwen-image-edit-2509-lightningv2.0-{num_inference_steps}steps.safetensors"
3232

3333
# Load the model
3434
transformer = NunchakuQwenImageTransformer2DModel.from_pretrained(model_path)
3535

3636
pipeline = QwenImageEditPlusPipeline.from_pretrained(
37-
"Qwen/Qwen-Image-Edit-2509", transformer=transformer, torch_dtype=torch.bfloat16
37+
"Qwen/Qwen-Image-Edit-2509", transformer=transformer, scheduler=scheduler, torch_dtype=torch.bfloat16
3838
)
3939

4040
if get_gpu_memory() > 18:

0 commit comments

Comments
 (0)