Ernie Image Turbo: Text To Image
Generate images from text prompts using the ERNIE-Image turbo model. Input a text description and receive a high-quality image with precise text rendering and…
Sobre
Generate images from text prompts using the ERNIE-Image turbo model. Input a text description and receive a high-quality image with precise text rendering and…
O que você fornece
- Lendo o fluxo de trabalho
É executado no ComfyUI. Este fluxo de trabalho não pode ser executado nesta página. Baixe-o e abra-o no ComfyUI.
Baixar workflowAinda não há exemplos de resultados para este fluxo de trabalho.
Dentro do workflow
Uma prévia somente leitura do gráfico de nós. Abra-o no Comfy Cloud ou faça o download para editar os nós.
Loading the graph
Open full-size workflow previewArquivos neste workflow
- Comfy Cloud
- Sim
- Saída
- Imagem
- Autor
- Autor indisponível
Requer nós personalizados
- Lendo o fluxo de trabalho
Use este fluxo de trabalho a partir do código
Gerado a partir do grafo e das entradas do fluxo de trabalho quando possível; caso contrário, são exibidos exemplos armazenados. Revise as credenciais e os endpoints antes de executar o código, pois isso pode gerar cobranças.
What you need
- Runs on
- Comfy Cloud
- Chave
- COMFY_API_KEY
Requer um plano pago do Cloud e créditos.
# 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-Turbo",
"images": [
"88:65",
0
]
},
"_meta": {
"title": "Save Image"
}
},
"88:100": {
"class_type": "PreviewAny",
"inputs": {},
"_meta": {
"title": "Preview as Text (Int to String)"
}
},
"88:101": {
"class_type": "StringReplace",
"inputs": {
"find": "{width}",
"replace": [
"88:99",
0
],
"string": [
"88:93",
0
]
},
"_meta": {
"title": "Replace Text"
}
},
"88:102": {
"class_type": "StringReplace",
"inputs": {
"find": "{height}",
"replace": [
"88:100",
0
],
"string": [
"88:101",
0
]
},
"_meta": {
"title": "Replace Text"
}
},
"88:103": {
"class_type": "PreviewAny",
"inputs": {
"source": [
"88:97",
0
]
},
"_meta": {
"title": "Preview as Text (Int to String)"
}
},
"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-turbo.safetensors",
"weight_dtype": "default"
},
"_meta": {
"title": "Load Diffusion Model"
}
},
"88:67": {
"class_type": "CLIPTextEncode",
"inputs": {
"clip": [
"88:62",
0
],
"text": [
"88:97",
0
]
},
"_meta": {
"title": "CLIP Text Encode (Prompt)"
}
},
"88:70": {
"class_type": "KSampler",
"inputs": {
"cfg": 1,
"denoise": 1,
"latent_image": [
"88:71",
0
],
"model": [
"88:66",
0
],
"negative": [
"88:91",
0
],
"positive": [
"88:67",
0
],
"sampler_name": "euler",
"scheduler": "simple",
"seed": 423299999918804,
"steps": 8
},
"_meta": {
"title": "KSampler"
}
},
"88:71": {
"class_type": "EmptyFlux2LatentImage",
"inputs": {
"batch_size": 1,
"height": 1024,
"width": 1024
},
"_meta": {
"title": "Empty Flux 2 Latent"
}
},
"88:91": {
"class_type": "ConditioningZeroOut",
"inputs": {
"conditioning": [
"88:67",
0
]
},
"_meta": {
"title": "Conditioning Zero Out"
}
},
"88:93": {
"class_type": "StringReplace",
"inputs": {
"find": "{prompt}",
"replace": [
"88:94",
0
],
"string": "<s>[SYSTEM_PROMPT]你是一个专业的文生图 Prompt 增强助手。你将收到用户的简短图片描述及目标生成分辨率,请据此扩写为一段内容丰富、细节充分的视觉描述,以帮助文生图模型生成高质量的图片。仅输出增强后的描述,不要包含任何解释或前缀。[/SYSTEM_PROMPT][INST]{\"prompt\": \"{prompt}\", \"width\": {width}, \"height\": {height}}[/INST]"
},
"_meta": {
"title": "Replace Text"
}
},
"88:94": {
"class_type": "PrimitiveStringMultiline",
"inputs": {
"value": "A stylized cinematic side-profile medium shot portrait of a young European woman with sleek dark hair in a tight low bun, wearing a crisp white ruffled-collar shirt, eyes closed in serene contemplation, standing against a moody, dark gradient deep indigo-blue twilight sky with layered misty mountain silhouettes in the background, extreme high-contrast split neon lighting: 95% of the scene bathed in deep, saturated cool cyan-blue ambient light (dim, moody, low-key), with a sharp, intense, vivid neon pink-orange rim light tracing her facial profile, neck, and collar, creating bold color blocking and a surreal, artistic aesthetic, minimalist composition, high-fashion editorial, 8K, ultra-sharp focus on subject, moody desaturated blue tones, dramatic contrast, atmospheric depth, tranquil introspective vibe, dark atmospheric background, no overexposure, stylized color grading, neon rim light glow, low-key cool fill light."
},
"_meta": {
"title": "String (Multiline - Prompt)"
}
},
"88:95": {
"class_type": "TextGenerateV2",
"inputs": {
"clip": [
"88:98",
0
],
"max_length": 2048,
"mtp": "auto",
"prompt": [
"88:102",
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:96": {
"class_type": "PrimitiveBoolean",
"inputs": {
"value": True
},
"_meta": {
"title": "Enable prompt enhancement?"
}
},
"88:97": {
"class_type": "ComfySwitchNode",
"inputs": {
"on_false": [
"88:94",
0
],
"on_true": [
"88:95",
0
],
"switch": [
"88:96",
0
]
},
"_meta": {
"title": "If/Else Switch"
}
},
"88:98": {
"class_type": "CLIPLoader",
"inputs": {
"clip_name": "ernie-image-prompt-enhancer.safetensors",
"device": "default",
"type": "flux2"
},
"_meta": {
"title": "Load CLIP (PE)"
}
},
"88:99": {
"class_type": "PreviewAny",
"inputs": {},
"_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)