Ernie Image: Text to Image
Generate images from text prompts using the ERNIE-Image model. Input a text description to produce detailed, structured visuals with a broad stylistic range.
下载工作流在 Cloud 中试用 API 文档
简介
Generate images from text prompts using the ERNIE-Image model. Input a text description to produce detailed, structured visuals with a broad stylistic range.
你需要提供
- 正在读取工作流
在 ComfyUI 中运行。 此工作流无法在本页面运行。请下载后在 ComfyUI 中打开。
下载工作流此工作流暂无示例输出。
查看工作流内部
节点图的只读预览。在 Comfy Cloud 中打开或下载后即可编辑节点。
Loading the graph
Open full-size workflow preview此工作流中的文件
- Comfy Cloud
- 是
- 输出
- 图像
- 作者
- 作者信息暂不可用
需要自定义节点
- 正在读取工作流
通过代码使用此工作流
尽可能根据工作流图和输入自动生成代码,否则显示已保存的示例。运行代码可能产生费用,请先核对凭据和端点。
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({
"73": {
"class_type": "SaveImage",
"inputs": {
"filename_prefix": "Ernie-Image",
"images": [
"88:65",
0
]
},
"_meta": {
"title": "Save Image"
}
},
"88:62": {
"class_type": "CLIPLoader",
"inputs": {
"clip_name": "ministral-3-3b.safetensors",
"device": "default",
"type": "flux2"
},
"_meta": {
"title": "Load CLIP"
}
},
"88:63": {
"class_type": "VAELoader",
"inputs": {
"vae_name": "flux2-vae.safetensors"
},
"_meta": {
"title": "Load VAE"
}
},
"88:65": {
"class_type": "VAEDecode",
"inputs": {
"samples": [
"88:70",
0
],
"vae": [
"88:63",
0
]
},
"_meta": {
"title": "VAE Decode"
}
},
"88:66": {
"class_type": "UNETLoader",
"inputs": {
"unet_name": "ernie-image.safetensors",
"weight_dtype": "default"
},
"_meta": {
"title": "Load Diffusion Model"
}
},
"88:67": {
"class_type": "CLIPTextEncode",
"inputs": {
"clip": [
"88:62",
0
],
"text": [
"88:75",
0
]
},
"_meta": {
"title": "CLIP Text Encode (Prompt)"
}
},
"88:70": {
"class_type": "KSampler",
"inputs": {
"cfg": 4,
"denoise": 1,
"latent_image": [
"88:71",
0
],
"model": [
"88:66",
0
],
"negative": [
"88:72",
0
],
"positive": [
"88:67",
0
],
"sampler_name": "euler",
"scheduler": "simple",
"seed": 182596410725960,
"steps": 20
},
"_meta": {
"title": "KSampler"
}
},
"88:71": {
"class_type": "EmptyFlux2LatentImage",
"inputs": {
"batch_size": 1,
"height": 1024,
"width": 1024
},
"_meta": {
"title": "Empty Flux 2 Latent"
}
},
"88:72": {
"class_type": "CLIPTextEncode",
"inputs": {
"clip": [
"88:62",
0
],
"text": ""
},
"_meta": {
"title": "CLIP Text Encode (Prompt)"
}
},
"88:74": {
"class_type": "TextGenerateV2",
"inputs": {
"clip": [
"88:91",
0
],
"max_length": 2048,
"mtp": "auto",
"prompt": [
"88:95",
0
],
"sampling_mode": "on",
"sampling_mode.min_p": 0.05,
"sampling_mode.presence_penalty": 0,
"sampling_mode.repetition_penalty": 1.05,
"sampling_mode.seed": 0,
"sampling_mode.temperature": 0.6,
"sampling_mode.top_k": 64,
"sampling_mode.top_p": 0.8,
"thinking": False,
"use_default_template": True
},
"_meta": {
"title": "Generate Text"
}
},
"88:75": {
"class_type": "ComfySwitchNode",
"inputs": {
"on_false": [
"88:78",
0
],
"on_true": [
"88:74",
0
],
"switch": [
"88:76",
0
]
},
"_meta": {
"title": "If/Else Switch"
}
},
"88:76": {
"class_type": "PrimitiveBoolean",
"inputs": {
"value": True
},
"_meta": {
"title": "Enable prompt enhancement?"
}
},
"88:78": {
"class_type": "PrimitiveStringMultiline",
"inputs": {
"value": "High-fashion style summer outfit infographic featuring color-coordinated floating elements arranged in an elegant expanded circular composition. It includes a breathable straw hat, a sleeveless organic cotton top, a flowing pleated skirt, handcrafted leather sandals, and a woven palm leaf handbag. Exquisite annotations highlight fabric breathability, refreshing texture, moisture-wicking properties, and seasonal comfort. The color palette adopts warm neutral tones—ivory white, terracotta, sand, and soft tan. Subtle dynamic trajectories and flowing fabric swirls suggest a gentle summer breeze, while bright natural sunlight creates soft shadows and sun-kissed sheen, in a Mediterranean style."
},
"_meta": {
"title": "String (Multiline - Prompt)"
}
},
"88:83": {
"class_type": "StringReplace",
"inputs": {
"find": "{prompt}",
"replace": [
"88:78",
0
],
"string": "<s>[SYSTEM_PROMPT]你是一个专业的文生图 Prompt 增强助手。你将收到用户的简短图片描述及目标生成分辨率,请据此扩写为一段内容丰富、细节充分的视觉描述,以帮助文生图模型生成高质量的图片。仅输出增强后的描述,不要包含任何解释或前缀。[/SYSTEM_PROMPT][INST]{\"prompt\": \"{prompt}\", \"width\": {width}, \"height\": {height}}[/INST]"
},
"_meta": {
"title": "Replace Text"
}
},
"88:91": {
"class_type": "CLIPLoader",
"inputs": {
"clip_name": "ernie-image-prompt-enhancer.safetensors",
"device": "default",
"type": "flux2"
},
"_meta": {
"title": "Load CLIP (PE)"
}
},
"88:92": {
"class_type": "PreviewAny",
"inputs": {},
"_meta": {
"title": "Preview as Text (Int to String)"
}
},
"88:93": {
"class_type": "PreviewAny",
"inputs": {},
"_meta": {
"title": "Preview as Text (Int to String)"
}
},
"88:94": {
"class_type": "StringReplace",
"inputs": {
"find": "{width}",
"replace": [
"88:92",
0
],
"string": [
"88:83",
0
]
},
"_meta": {
"title": "Replace Text"
}
},
"88:95": {
"class_type": "StringReplace",
"inputs": {
"find": "{height}",
"replace": [
"88:93",
0
],
"string": [
"88:94",
0
]
},
"_meta": {
"title": "Replace Text"
}
},
"88:97": {
"class_type": "PreviewAny",
"inputs": {
"source": [
"88:75",
0
]
},
"_meta": {
"title": "Preview as Text (Int to String)"
}
}
})
# run() also passes api_key to the partner nodes in this workflow.
job = client.run(workflow, api_key=api_key)相关工作流
- EERNIE-Image
Ernie Image Turbo: Text To Image
- ZZ-Image-Turbo
1.1 入门 - 文本生成图像
- Nano Banana 2 Text-to-Image
3x3 联系表
- AAnima
Anima Anime 文生图生成
- AAnima
Anima Base v1: 文本生成图像
- AAnima
Anima Lllite: Any Control to Image
- AAnima
Anima Lllite: Depth Control to Image
- AAnima
Anima Lllite: Image Inpainting
- QQuiver
Arrow 2: Text to SVG
- BBoogu
Boogu Turbo: Text to Image
- BRIA
Bria: FIBO 2.0 Text to Image
- CChroma, Flux
Chroma: 文生图