Skip to content

Commit 6a46f32

Browse files
committed
update Qwen-Image Quickstart
1 parent 4641d0f commit 6a46f32

File tree

4 files changed

+20
-6
lines changed

4 files changed

+20
-6
lines changed

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ Details: [./examples/qwen_image/](./examples/qwen_image/)
6464

6565
```python
6666
from diffsynth.pipelines.qwen_image import QwenImagePipeline, ModelConfig
67+
from PIL import Image
6768
import torch
6869

6970
pipe = QwenImagePipeline.from_pretrained(
@@ -77,7 +78,10 @@ pipe = QwenImagePipeline.from_pretrained(
7778
tokenizer_config=ModelConfig(model_id="Qwen/Qwen-Image", origin_file_pattern="tokenizer/"),
7879
)
7980
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."
80-
image = pipe(prompt, seed=0, num_inference_steps=40)
81+
image = pipe(
82+
prompt, seed=0, num_inference_steps=40,
83+
# edit_image=Image.open("xxx.jpg").resize((1328, 1328)) # For Qwen-Image-Edit
84+
)
8185
image.save("image.jpg")
8286
```
8387

README_zh.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ DiffSynth-Studio 为主流 Diffusion 模型(包括 FLUX、Wan 等)重新设
6666

6767
```python
6868
from diffsynth.pipelines.qwen_image import QwenImagePipeline, ModelConfig
69+
from PIL import Image
6970
import torch
7071

7172
pipe = QwenImagePipeline.from_pretrained(
@@ -79,7 +80,10 @@ pipe = QwenImagePipeline.from_pretrained(
7980
tokenizer_config=ModelConfig(model_id="Qwen/Qwen-Image", origin_file_pattern="tokenizer/"),
8081
)
8182
prompt = "精致肖像,水下少女,蓝裙飘逸,发丝轻扬,光影透澈,气泡环绕,面容恬静,细节精致,梦幻唯美。"
82-
image = pipe(prompt, seed=0, num_inference_steps=40)
83+
image = pipe(
84+
prompt, seed=0, num_inference_steps=40,
85+
# edit_image=Image.open("xxx.jpg").resize((1328, 1328)) # For Qwen-Image-Edit
86+
)
8387
image.save("image.jpg")
8488
```
8589

examples/qwen_image/README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ Run the following code to quickly load the [Qwen/Qwen-Image](https://www.modelsc
2020

2121
```python
2222
from diffsynth.pipelines.qwen_image import QwenImagePipeline, ModelConfig
23+
from PIL import Image
2324
import torch
2425

25-
2626
pipe = QwenImagePipeline.from_pretrained(
2727
torch_dtype=torch.bfloat16,
2828
device="cuda",
@@ -34,7 +34,10 @@ pipe = QwenImagePipeline.from_pretrained(
3434
tokenizer_config=ModelConfig(model_id="Qwen/Qwen-Image", origin_file_pattern="tokenizer/"),
3535
)
3636
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."
37-
image = pipe(prompt, seed=0, num_inference_steps=40)
37+
image = pipe(
38+
prompt, seed=0, num_inference_steps=40,
39+
# edit_image=Image.open("xxx.jpg").resize((1328, 1328)) # For Qwen-Image-Edit
40+
)
3841
image.save("image.jpg")
3942
```
4043

examples/qwen_image/README_zh.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ pip install -e .
2020

2121
```python
2222
from diffsynth.pipelines.qwen_image import QwenImagePipeline, ModelConfig
23+
from PIL import Image
2324
import torch
2425

25-
2626
pipe = QwenImagePipeline.from_pretrained(
2727
torch_dtype=torch.bfloat16,
2828
device="cuda",
@@ -34,7 +34,10 @@ pipe = QwenImagePipeline.from_pretrained(
3434
tokenizer_config=ModelConfig(model_id="Qwen/Qwen-Image", origin_file_pattern="tokenizer/"),
3535
)
3636
prompt = "精致肖像,水下少女,蓝裙飘逸,发丝轻扬,光影透澈,气泡环绕,面容恬静,细节精致,梦幻唯美。"
37-
image = pipe(prompt, seed=0, num_inference_steps=40)
37+
image = pipe(
38+
prompt, seed=0, num_inference_steps=40,
39+
# edit_image=Image.open("xxx.jpg").resize((1328, 1328)) # For Qwen-Image-Edit
40+
)
3841
image.save("image.jpg")
3942
```
4043

0 commit comments

Comments
 (0)