Views
No views yet
| Original Model | Original Model | Accelerated Model | |
|---|---|---|---|
| Inference Steps | 40 | 15 | 15 |
| CFG Scale | 4 | 1 | 1 |
| Forward Passes | 80 | 15 | 15 |
| Example 1 | ![]() | ![]() | ![]() |
| Example 2 | ![]() | ![]() | ![]() |
| Example 3 | ![]() | ![]() | ![]() |
1git clone https://github.com/modelscope/DiffSynth-Studio.git
2cd DiffSynth-Studio
3pip install -e .1from diffsynth.pipelines.qwen_image import QwenImagePipeline, ModelConfig
2from modelscope import snapshot_download
3import torch
4
5snapshot_download("DiffSynth-Studio/Qwen-Image-Distill-LoRA", local_dir="models/DiffSynth-Studio/Qwen-Image-Distill-LoRA")
6pipe = QwenImagePipeline.from_pretrained(
7 torch_dtype=torch.bfloat16,
8 device="cuda",
9 model_configs=[
10 ModelConfig(model_id="Qwen/Qwen-Image", origin_file_pattern="transformer/diffusion_pytorch_model*.safetensors"),
11 ModelConfig(model_id="Qwen/Qwen-Image", origin_file_pattern="text_encoder/model*.safetensors"),
12 ModelConfig(model_id="Qwen/Qwen-Image", origin_file_pattern="vae/diffusion_pytorch_model.safetensors"),
13 ],
14 tokenizer_config=ModelConfig(model_id="Qwen/Qwen-Image", origin_file_pattern="tokenizer/"),
15)
16pipe.load_lora(pipe.dit, "models/DiffSynth-Studio/Qwen-Image-Distill-LoRA/model.safetensors")
17
18prompt = "Exquisite portrait, underwater girl, flowing blue dress, gently floating hair, translucent lighting, surrounded by bubbles, serene expression, intricate details, dreamy and ethereal."
19image = pipe(prompt, seed=0, num_inference_steps=15, cfg_scale=1)
20image.save("image.jpg")