Downloads · 30 days
0
Lakonik/pi-Qwen-Image
pi-Qwen-Image is a text-to-image model from Lakonik. Use it when you need an image from a text prompt. It is set up for diffusers. The card lists the license as apache-2.0.
Distilled 4-step Qwen-Image models proposed in the paper:
Downloads · 30 days
0
Access
Public
Updated Jun 6, 2026
Repo size
5.8 GB
Likes
20
Public
Click a slice to open those files.
.safetensors5.8 GB · 100%
From the Hugging Face model README
Distilled 4-step Qwen-Image models proposed in the paper:
pi-Flow: Policy-Based Few-Step Generation via Imitation Distillation <br> Hansheng Chen<sup>1</sup>, Kai Zhang<sup>2</sup>, Hao Tan<sup>2</sup>, Leonidas Guibas<sup>1</sup>, Gordon Wetzstein<sup>1</sup>, Sai Bi<sup>2</sup><br> <sup>1</sup>Stanford University, <sup>2</sup>Adobe Research <br> [arXiv] [Code] [pi-Qwen Demo🤗] [pi-FLUX Demo🤗] [pi-FLUX.2 Demo🤗]

Please first install the official code repository.
We provide diffusers pipelines for easy inference. The following code demonstrates how to sample images from the distilled FLUX models.
Note: GM-Qwen supports elastic inference. Feel free to set num_inference_steps to any value above 4.
import torch
from lakonlab.models.diffusions.schedulers import FlowMapSDEScheduler
from lakonlab.pipelines.pipeline_piqwen import PiQwenImagePipeline
pipe = PiQwenImagePipeline.from_pretrained(
'Qwen/Qwen-Image',
torch_dtype=torch.bfloat16)
adapter_name = pipe.load_piflow_adapter( # you may later call `pipe.set_adapters([adapter_name, ...])` to combine other adapters (e.g., style LoRAs)
'Lakonik/pi-Qwen-Image',
subfolder='gmqwen_k8_piid_4step',
target_module_name='transformer')
pipe.scheduler = FlowMapSDEScheduler.from_config( # use fixed shift=3.2
pipe.scheduler.config, shift=3.2, use_dynamic_shifting=False, final_step_size_scale=0.5)
pipe = pipe.to('cuda')
out = pipe(
prompt='Photo of a coffee shop entrance featuring a chalkboard sign reading "π-Qwen Coffee 😊 $2 per cup," with a neon '
'light beside it displaying "π-通义千问". Next to it hangs a poster showing a beautiful Chinese woman, '
'and beneath the poster is written "e≈2.71828-18284-59045-23536-02874-71352".',
width=1920,
height=1080,
num_inference_steps=4,
generator=torch.Generator().manual_seed(42),
).images[0]
out.save('gmqwen_4nfe.png')

import torch
from lakonlab.models.diffusions.schedulers import FlowMapSDEScheduler
from lakonlab.pipelines.pipeline_piqwen import PiQwenImagePipeline
pipe = PiQwenImagePipeline.from_pretrained(
'Qwen/Qwen-Image',
policy_type='DX',
policy_kwargs=dict(
segment_size=1 / 3.5, # 1 / (nfe - 1 + final_step_size_scale)
shift=3.2),
torch_dtype=torch.bfloat16)
adapter_name = pipe.load_piflow_adapter( # you may later call `pipe.set_adapters([adapter_name, ...])` to combine other adapters (e.g., style LoRAs)
'Lakonik/pi-Qwen-Image',
subfolder='dxqwen_n10_piid_4step',
target_module_name='transformer')
pipe.scheduler = FlowMapSDEScheduler.from_config( # use fixed shift=3.2
pipe.scheduler.config, shift=3.2, use_dynamic_shifting=False, final_step_size_scale=0.5)
pipe = pipe.to('cuda')
out = pipe(
prompt='Photo of a coffee shop entrance featuring a chalkboard sign reading "π-Qwen Coffee 😊 $2 per cup," with a neon '
'light beside it displaying "π-通义千问". Next to it hangs a poster showing a beautiful Chinese woman, '
'and beneath the poster is written "e≈2.71828-18284-59045-23536-02874-71352".',
width=1920,
height=1080,
num_inference_steps=4,
generator=torch.Generator().manual_seed(42),
).images[0]
out.save('dxqwen_4nfe.png')

@misc{piflow,
title={pi-Flow: Policy-Based Few-Step Generation via Imitation Distillation},
author={Hansheng Chen and Kai Zhang and Hao Tan and Leonidas Guibas and Gordon Wetzstein and Sai Bi},
year={2025},
eprint={2510.14974},
archivePrefix={arXiv},
primaryClass={cs.LG},
url={https://arxiv.org/abs/2510.14974},
}