OpenAI: ChatGPT
Engage with OpenAI's advanced language models for intelligent conversations.
下载工作流在 Cloud 中试用 API 文档
简介
Engage with OpenAI's advanced language models for intelligent conversations.
你需要提供
- 正在读取工作流
在 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({
"5": {
"class_type": "LoadImage",
"inputs": {
"image": "example.png"
},
"_meta": {
"title": "Load Image"
}
},
"19": {
"class_type": "SaveText",
"inputs": {
"filename_prefix": "Text/GPT",
"format": "txt",
"text": [
"20",
0
]
},
"_meta": {
"title": "Save Text"
}
},
"20": {
"class_type": "OpenAIChatNodeV2",
"inputs": {
"model": "gpt-6.2-sol",
"model.images.image_1": [
"5",
0
],
"model.max_output_tokens": 32768,
"model.prompt": "Describe this image",
"model.reasoning_effort": "medium",
"model.seed": 42,
"model.system_prompt": [
"21",
0
]
},
"_meta": {
"title": "OpenAI ChatGPT"
}
},
"21": {
"class_type": "PrimitiveStringMultiline",
"inputs": {
"value": "You are an AI specialized in image-to-text prompt generation. Analyze the given image carefully and describe it in a detailed, structured, and prompt-friendly format. Include elements such as subject, clothing, style, environment, lighting, composition, color palette, mood, camera angle, and any other relevant visual details. Your output should resemble a high-quality text-to-image prompt that can help recreate the image. Use concise, descriptive language. Do not include explanations, just output the prompt."
},
"_meta": {
"title": "Text (Multiline)"
}
}
})
# run() also passes api_key to the partner nodes in this workflow.
job = client.run(workflow, api_key=api_key)