文字轉圖像(新版)
使用 Z-Image-Turbo 模型,從文字提示生成圖像。
下載工作流程在 Cloud 中試用 API 文件
工作流程內部
來源範本的唯讀預覽。請在 Cloud 中開啟,以探索節點並進行變更。
Loading the graph
Open full-size workflow preview從您的程式碼呼叫此模型
以下請求使用與 Playground 相同的已準備節點圖和設定。每次提交都可能啟動付費執行;若提交結果不明,請勿自動重試提交。
1 取得 API 金鑰 ↗
What you need
- Runs on
- Comfy Cloud
- 金鑰
- COMFY_API_KEY
需要付費 Cloud 方案與點數。
下載 API JSONAPI 文件 ↗
# Python 3.10+: pip install comfy-sdk==0.4.0
import os
from comfy_sdk import Comfy
api_key = os.environ.get("COMFY_API_KEY", "").strip()
if not api_key: raise RuntimeError("Set COMFY_API_KEY")
os.environ.setdefault("COMFY_BASE_URL", "https://cloud.comfy.org")
client = Comfy(api_key=api_key)
workflow = client.workflows.from_json({
"60": {
"class_type": "SaveImage",
"inputs": {
"filename_prefix": "z-image-turbo",
"images": [
"83:8",
0
]
},
"_meta": {
"title": "Save Image"
}
},
"83:13": {
"class_type": "EmptySD3LatentImage",
"inputs": {
"batch_size": 1,
"height": 768,
"width": 1344
},
"_meta": {
"title": "EmptySD3LatentImage"
}
},
"83:27": {
"class_type": "CLIPTextEncode",
"inputs": {
"clip": [
"83:30",
0
],
"text": "A surreal graphic poster set against a rain-drenched futuristic metropolis alleyway, where reflective puddles mirror flashing holographic billboards. In the center, a solitary bioluminescent lotus radiates an intense emerald and violet glow, its dew-covered petals pulsing with liquid light. Standing to the side, a slender young South Asian cybernetic courier with shaved temples and an iridescent teal topknot gazes at the blossom, wearing a soaked translucent vinyl trench coat over utilitarian dark mesh. Cascading rainwater and misty atmospheric vapor drift across the sprawling panoramic vista, blurring towering neon-lit architecture in the distance. Above the blooming aquatic flora, bold distressed typographic lettering reads \"AETHERIS\" in clean geometric stenciling. The visual combines wet urban grain, high-contrast shadows, and cinematic teal and magenta grading across the expansive composition."
},
"_meta": {
"title": "CLIP Text Encode (Prompt)"
}
},
"83:28": {
"class_type": "UNETLoader",
"inputs": {
"unet_name": "z_image_turbo_bf16.safetensors",
"weight_dtype": "default"
},
"_meta": {
"title": "Load Diffusion Model"
}
},
"83:29": {
"class_type": "VAELoader",
"inputs": {
"vae_name": "ae.safetensors"
},
"_meta": {
"title": "Load VAE"
}
},
"83:3": {
"class_type": "KSampler",
"inputs": {
"cfg": 1,
"denoise": 1,
"latent_image": [
"83:13",
0
],
"model": [
"83:28",
0
],
"negative": [
"83:33",
0
],
"positive": [
"83:27",
0
],
"sampler_name": "res_multistep",
"scheduler": "simple",
"seed": 528562900154240,
"steps": 4
},
"_meta": {
"title": "KSampler"
}
},
"83:30": {
"class_type": "CLIPLoader",
"inputs": {
"clip_name": "qwen_3_4b.safetensors",
"device": "default",
"type": "lumina2"
},
"_meta": {
"title": "Load CLIP"
}
},
"83:33": {
"class_type": "ConditioningZeroOut",
"inputs": {
"conditioning": [
"83:27",
0
]
},
"_meta": {
"title": "Conditioning Zero Out"
}
},
"83:8": {
"class_type": "VAEDecode",
"inputs": {
"samples": [
"83:3",
0
],
"vae": [
"83:29",
0
]
},
"_meta": {
"title": "VAE Decode"
}
}
})
# run() also passes api_key to the partner nodes in this workflow.
job = client.run(workflow, api_key=api_key)
for output in job.get_outputs("60"):
output.to_file(output.name)試試範例
關於此工作流程
「文字轉圖像(新版)」工作流程運用先進的 Z-Image-Turbo 模型,將文字提示轉化為鮮明、高品質圖像。此模型在生成速度與畫質上皆有顯著提升,採用新架構降低運算負擔,同時維持細節與色彩準確度,特別適合需要快速生成圖像又不犧牲品質的應用。
Z-Image-Turbo 的創新之處在於其強化的自然語言處理能力,能更精確解析複雜提示,讓生成圖像更貼近原意。整合至 ComfyUI 工作流程後,使用者可享受更直覺、高效的圖像創作體驗,無論專業創作者或興趣者皆適用。
問答
Z-Image-Turbo 透過優化運算效率與自然語言處理,提升生成速度與圖像品質。
不需特殊硬體,但若有高效能 GPU,生成速度與體驗會更佳。
可以,調整文字提示並運用子圖功能即可進階修改。
非常適合,其高品質與高效率輸出適用於各類創意產業。