From 6a46f32afe4c148065613aa78f53b78b2d8f52f0 Mon Sep 17 00:00:00 2001 From: Artiprocher Date: Fri, 29 Aug 2025 14:09:49 +0800 Subject: [PATCH] update Qwen-Image Quickstart --- README.md | 6 +++++- README_zh.md | 6 +++++- examples/qwen_image/README.md | 7 +++++-- examples/qwen_image/README_zh.md | 7 +++++-- 4 files changed, 20 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 1164c05..96b307a 100644 --- a/README.md +++ b/README.md @@ -64,6 +64,7 @@ Details: [./examples/qwen_image/](./examples/qwen_image/) ```python from diffsynth.pipelines.qwen_image import QwenImagePipeline, ModelConfig +from PIL import Image import torch pipe = QwenImagePipeline.from_pretrained( @@ -77,7 +78,10 @@ pipe = QwenImagePipeline.from_pretrained( tokenizer_config=ModelConfig(model_id="Qwen/Qwen-Image", origin_file_pattern="tokenizer/"), ) prompt = "A detailed portrait of a girl underwater, wearing a blue flowing dress, hair gently floating, clear light and shadow, surrounded by bubbles, calm expression, fine details, dreamy and beautiful." -image = pipe(prompt, seed=0, num_inference_steps=40) +image = pipe( + prompt, seed=0, num_inference_steps=40, + # edit_image=Image.open("xxx.jpg").resize((1328, 1328)) # For Qwen-Image-Edit +) image.save("image.jpg") ``` diff --git a/README_zh.md b/README_zh.md index 2e00c5d..abc276d 100644 --- a/README_zh.md +++ b/README_zh.md @@ -66,6 +66,7 @@ DiffSynth-Studio 为主流 Diffusion 模型(包括 FLUX、Wan 等)重新设 ```python from diffsynth.pipelines.qwen_image import QwenImagePipeline, ModelConfig +from PIL import Image import torch pipe = QwenImagePipeline.from_pretrained( @@ -79,7 +80,10 @@ pipe = QwenImagePipeline.from_pretrained( tokenizer_config=ModelConfig(model_id="Qwen/Qwen-Image", origin_file_pattern="tokenizer/"), ) prompt = "精致肖像,水下少女,蓝裙飘逸,发丝轻扬,光影透澈,气泡环绕,面容恬静,细节精致,梦幻唯美。" -image = pipe(prompt, seed=0, num_inference_steps=40) +image = pipe( + prompt, seed=0, num_inference_steps=40, + # edit_image=Image.open("xxx.jpg").resize((1328, 1328)) # For Qwen-Image-Edit +) image.save("image.jpg") ``` diff --git a/examples/qwen_image/README.md b/examples/qwen_image/README.md index db1cb83..15e4df9 100644 --- a/examples/qwen_image/README.md +++ b/examples/qwen_image/README.md @@ -20,9 +20,9 @@ Run the following code to quickly load the [Qwen/Qwen-Image](https://www.modelsc ```python from diffsynth.pipelines.qwen_image import QwenImagePipeline, ModelConfig +from PIL import Image import torch - pipe = QwenImagePipeline.from_pretrained( torch_dtype=torch.bfloat16, device="cuda", @@ -34,7 +34,10 @@ pipe = QwenImagePipeline.from_pretrained( tokenizer_config=ModelConfig(model_id="Qwen/Qwen-Image", origin_file_pattern="tokenizer/"), ) prompt = "A detailed portrait of a girl underwater, wearing a blue flowing dress, hair gently floating, clear light and shadow, surrounded by bubbles, calm expression, fine details, dreamy and beautiful." -image = pipe(prompt, seed=0, num_inference_steps=40) +image = pipe( + prompt, seed=0, num_inference_steps=40, + # edit_image=Image.open("xxx.jpg").resize((1328, 1328)) # For Qwen-Image-Edit +) image.save("image.jpg") ``` diff --git a/examples/qwen_image/README_zh.md b/examples/qwen_image/README_zh.md index db958a7..97ab4c9 100644 --- a/examples/qwen_image/README_zh.md +++ b/examples/qwen_image/README_zh.md @@ -20,9 +20,9 @@ pip install -e . ```python from diffsynth.pipelines.qwen_image import QwenImagePipeline, ModelConfig +from PIL import Image import torch - pipe = QwenImagePipeline.from_pretrained( torch_dtype=torch.bfloat16, device="cuda", @@ -34,7 +34,10 @@ pipe = QwenImagePipeline.from_pretrained( tokenizer_config=ModelConfig(model_id="Qwen/Qwen-Image", origin_file_pattern="tokenizer/"), ) prompt = "精致肖像,水下少女,蓝裙飘逸,发丝轻扬,光影透澈,气泡环绕,面容恬静,细节精致,梦幻唯美。" -image = pipe(prompt, seed=0, num_inference_steps=40) +image = pipe( + prompt, seed=0, num_inference_steps=40, + # edit_image=Image.open("xxx.jpg").resize((1328, 1328)) # For Qwen-Image-Edit +) image.save("image.jpg") ```