QJerry commited on
Commit
7bd56ea
·
verified ·
1 Parent(s): 108d6b8

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +7 -7
README.md CHANGED
@@ -79,6 +79,7 @@ HF_XET_HIGH_PERFORMANCE=1 hf download Tongyi-MAI/Z-Image
79
  - **Guidance scale:** 3.0 – 5.0
80
  - **Inference steps:** 28 – 50
81
  - **Negative prompts:** Strongly recommended for better control
 
82
 
83
  ### Usage Example
84
 
@@ -86,8 +87,7 @@ HF_XET_HIGH_PERFORMANCE=1 hf download Tongyi-MAI/Z-Image
86
  import torch
87
  from diffusers import ZImagePipeline
88
 
89
- # 1. Load the pipeline
90
- # Use bfloat16 for optimal performance on supported GPUs
91
  pipe = ZImagePipeline.from_pretrained(
92
  "Tongyi-MAI/Z-Image",
93
  torch_dtype=torch.bfloat16,
@@ -95,18 +95,18 @@ pipe = ZImagePipeline.from_pretrained(
95
  )
96
  pipe.to("cuda")
97
 
98
- # 2. Generate Image
99
  prompt = "两名年轻亚裔女性紧密站在一起,背景为朴素的灰色纹理墙面,可能是室内地毯地面。左侧女性留着长卷发,身穿藏青色毛衣,左袖有奶油色褶皱装饰,内搭白色立领衬衫,下身白色裤子;佩戴小巧金色耳钉,双臂交叉于背后。右侧女性留直肩长发,身穿奶油色卫衣,胸前印有“Tunthetables”字样,下方为“New ideas”,搭配白色裤子;佩戴银色小环耳环,双臂交叉于胸前。两人均面带微笑直视镜头。照片,自然光照明,柔和阴影,以藏青、奶油白为主的中性色调,休闲时尚摄影,中等景深,面部和上半身对焦清晰,姿态放松,表情友好,室内环境,地毯地面,纯色背景。"
100
- negative_prompt = "" # optional, but would be powerful when you want to remove some unwanted content
101
 
102
  image = pipe(
103
  prompt=prompt,
104
  negative_prompt=negative_prompt,
105
  height=1280,
106
  width=720,
107
- cfg_normalization=False, # Could switch if needed: True for more realism, False for general stylism
108
- num_inference_steps=50, # May use 28-50 for Z-Image Model
109
- guidance_scale=4.0, # Suggested guidance scale is 3.0 to 5.0 for Z-Image Model
110
  generator=torch.Generator("cuda").manual_seed(42),
111
  ).images[0]
112
 
 
79
  - **Guidance scale:** 3.0 – 5.0
80
  - **Inference steps:** 28 – 50
81
  - **Negative prompts:** Strongly recommended for better control
82
+ - **CFG normalization:** `False` for general stylism, `True` for more realism
83
 
84
  ### Usage Example
85
 
 
87
  import torch
88
  from diffusers import ZImagePipeline
89
 
90
+ # Load the pipeline
 
91
  pipe = ZImagePipeline.from_pretrained(
92
  "Tongyi-MAI/Z-Image",
93
  torch_dtype=torch.bfloat16,
 
95
  )
96
  pipe.to("cuda")
97
 
98
+ # Generate image
99
  prompt = "两名年轻亚裔女性紧密站在一起,背景为朴素的灰色纹理墙面,可能是室内地毯地面。左侧女性留着长卷发,身穿藏青色毛衣,左袖有奶油色褶皱装饰,内搭白色立领衬衫,下身白色裤子;佩戴小巧金色耳钉,双臂交叉于背后。右侧女性留直肩长发,身穿奶油色卫衣,胸前印有“Tunthetables”字样,下方为“New ideas”,搭配白色裤子;佩戴银色小环耳环,双臂交叉于胸前。两人均面带微笑直视镜头。照片,自然光照明,柔和阴影,以藏青、奶油白为主的中性色调,休闲时尚摄影,中等景深,面部和上半身对焦清晰,姿态放松,表情友好,室内环境,地毯地面,纯色背景。"
100
+ negative_prompt = "" # Optional, but would be powerful when you want to remove some unwanted content
101
 
102
  image = pipe(
103
  prompt=prompt,
104
  negative_prompt=negative_prompt,
105
  height=1280,
106
  width=720,
107
+ cfg_normalization=True,
108
+ num_inference_steps=50,
109
+ guidance_scale=4.0,
110
  generator=torch.Generator("cuda").manual_seed(42),
111
  ).images[0]
112