1 input multiple styles from prompt
Upload an image and generate 12 stylized variations in under 15 seconds using Grok Imagine Quality.
简介
This ComfyUI tutorial shows you how to turn a single image into a gallery of 12 distinct styles using prompt-driven editing. The workflow is simple and fast: LoadImage imports your source, the image fans out to twelve GrokImageEditNodeV2 instances (each driven by a different style prompt and the Grok Imagine Quality engine), and each result is written to disk by a SaveImage node. The result is a quick style board that’s ideal for exploration, A/B testing, or presenting options to a client.
Technically, the graph duplicates the same input image across parallel branches. Each GrokImageEditNodeV2 applies the style instructions you provide (e.g., “watercolor sketch,” “cyberpunk neon,” “studio portrait retouch”) while preserving the core content and composition of the original. SaveImage nodes handle file naming and output paths so every variant is saved separately. Because each branch is independent, ComfyUI can schedule work efficiently, and the Grok Imagine Quality model is optimized for rapid, consistent edits—making it practical to generate a dozen variations in a single run.
你需要提供
- 正在读取工作流
在 ComfyUI 中运行。 此工作流无法在本页面运行。你可以在 Comfy Cloud 中打开(已预先加载所需内容),或下载后在自己的 ComfyUI 中使用。
在 Cloud 中试用查看工作流内部
节点图的只读预览。在 Comfy Cloud 中打开或下载后即可编辑节点。
Loading the graph
Open full-size workflow preview- 作者
- Rob
需要自定义节点
- 正在读取工作流
通过代码使用此工作流
尽可能根据工作流图和输入自动生成代码,否则显示已保存的示例。运行代码可能产生费用,请先核对凭据和端点。
What you need
- Runs on
- Comfy Cloud
- 密钥
- COMFY_API_KEY
- 你的文件
- 由代码根据链接上传
需要付费的 Cloud 方案和额度。
# 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({
"1": {
"class_type": "LoadImage",
"inputs": {
"image": "UPLOADED_image_FILENAME"
},
"_meta": {
"title": "Load Image"
}
},
"4": {
"class_type": "GrokImageEditNodeV2",
"inputs": {
"model": "grok-imagine-image-quality",
"model.aspect_ratio": "auto",
"model.images.image_1": [
"1",
0
],
"model.number_of_images": 1,
"model.resolution": "1K",
"prompt": "Change the style into 3d animation, maintain character and background identity",
"seed": 923725119
},
"_meta": {
"title": "Grok Image Edit"
}
},
"5": {
"class_type": "SaveImage",
"inputs": {
"filename_prefix": "ComfyUI-3d",
"images": [
"4",
0
]
},
"_meta": {
"title": "Save Image"
}
},
"6": {
"class_type": "GrokImageEditNodeV2",
"inputs": {
"model": "grok-imagine-image-quality",
"model.aspect_ratio": "auto",
"model.images.image_1": [
"1",
0
],
"model.number_of_images": 1,
"model.resolution": "1K",
"prompt": "Change the style into claymation, maintain character and background identity",
"seed": 626651379
},
"_meta": {
"title": "Grok Image Edit"
}
},
"7": {
"class_type": "SaveImage",
"inputs": {
"filename_prefix": "ComfyUI-claymation",
"images": [
"6",
0
]
},
"_meta": {
"title": "Save Image"
}
},
"10": {
"class_type": "GrokImageEditNodeV2",
"inputs": {
"model": "grok-imagine-image-quality",
"model.aspect_ratio": "auto",
"model.images.image_1": [
"1",
0
],
"model.number_of_images": 1,
"model.resolution": "1K",
"prompt": "Change the style into hyper realistic, maintain character and background identity",
"seed": 778259071
},
"_meta": {
"title": "Grok Image Edit"
}
},
"11": {
"class_type": "SaveImage",
"inputs": {
"filename_prefix": "ComfyUI-realistic",
"images": [
"10",
0
]
},
"_meta": {
"title": "Save Image"
}
},
"12": {
"class_type": "GrokImageEditNodeV2",
"inputs": {
"model": "grok-imagine-image-quality",
"model.aspect_ratio": "auto",
"model.images.image_1": [
"1",
0
],
"model.number_of_images": 1,
"model.resolution": "1K",
"prompt": "Change the style into cross stitch, maintain character and background identity",
"seed": 1315151478
},
"_meta": {
"title": "Grok Image Edit"
}
},
"13": {
"class_type": "SaveImage",
"inputs": {
"filename_prefix": "ComfyUI-cross_stitch",
"images": [
"12",
0
]
},
"_meta": {
"title": "Save Image"
}
},
"14": {
"class_type": "GrokImageEditNodeV2",
"inputs": {
"model": "grok-imagine-image-quality",
"model.aspect_ratio": "auto",
"model.images.image_1": [
"1",
0
],
"model.number_of_images": 1,
"model.resolution": "1K",
"prompt": "Change the style into oil painting with visible brushstrokes, maintain character and background identity",
"seed": 2089487176
},
"_meta": {
"title": "Grok Image Edit"
}
},
"15": {
"class_type": "SaveImage",
"inputs": {
"filename_prefix": "ComfyUI-oil_painting",
"images": [
"14",
0
]
},
"_meta": {
"title": "Save Image"
}
},
"16": {
"class_type": "GrokImageEditNodeV2",
"inputs": {
"model": "grok-imagine-image-quality",
"model.aspect_ratio": "auto",
"model.images.image_1": [
"1",
0
],
"model.number_of_images": 1,
"model.resolution": "1K",
"prompt": "Change the style into detailed colored pencil, maintain character and background identity",
"seed": 1783897462
},
"_meta": {
"title": "Grok Image Edit"
}
},
"17": {
"class_type": "SaveImage",
"inputs": {
"filename_prefix": "ComfyUI-colored_pencil",
"images": [
"16",
0
]
},
"_meta": {
"title": "Save Image"
}
},
"18": {
"class_type": "GrokImageEditNodeV2",
"inputs": {
"model": "grok-imagine-image-quality",
"model.aspect_ratio": "auto",
"model.images.image_1": [
"1",
0
],
"model.number_of_images": 1,
"model.resolution": "1K",
"prompt": "Change the style into flat vector illustration, maintain character and background identity",
"seed": 2035280383
},
"_meta": {
"title": "Grok Image Edit"
}
},
"19": {
"class_type": "SaveImage",
"inputs": {
"filename_prefix": "ComfyUI-vector",
"images": [
"18",
0
]
},
"_meta": {
"title": "Save Image"
}
},
"20": {
"class_type": "GrokImageEditNodeV2",
"inputs": {
"model": "grok-imagine-image-quality",
"model.aspect_ratio": "auto",
"model.images.image_1": [
"1",
0
],
"model.number_of_images": 1,
"model.resolution": "1K",
"prompt": "Change the style into reflective metal sculpture, maintain character and background identity",
"seed": 1158415507
},
"_meta": {
"title": "Grok Image Edit"
}
},
"21": {
"class_type": "SaveImage",
"inputs": {
"filename_prefix": "ComfyUI-metal",
"images": [
"20",
0
]
},
"_meta": {
"title": "Save Image"
}
},
"22": {
"class_type": "GrokImageEditNodeV2",
"inputs": {
"model": "grok-imagine-image-quality",
"model.aspect_ratio": "auto",
"model.images.image_1": [
"1",
0
],
"model.number_of_images": 1,
"model.resolution": "1K",
"prompt": "Change the style into charcoal sketch, maintain character and background identity",
"seed": 635577419
},
"_meta": {
"title": "Grok Image Edit"
}
},
"23": {
"class_type": "SaveImage",
"inputs": {
"filename_prefix": "ComfyUI-charcoal",
"images": [
"22",
0
]
},
"_meta": {
"title": "Save Image"
}
},
"24": {
"class_type": "GrokImageEditNodeV2",
"inputs": {
"model": "grok-imagine-image-quality",
"model.aspect_ratio": "auto",
"model.images.image_1": [
"1",
0
],
"model.number_of_images": 1,
"model.resolution": "1K",
"prompt": "Change the style into lineart, maintain character and background identity",
"seed": 280525599
},
"_meta": {
"title": "Grok Image Edit"
}
},
"25": {
"class_type": "SaveImage",
"inputs": {
"filename_prefix": "ComfyUI-lineart",
"images": [
"24",
0
]
},
"_meta": {
"title": "Save Image"
}
},
"26": {
"class_type": "GrokImageEditNodeV2",
"inputs": {
"model": "grok-imagine-image-quality",
"model.aspect_ratio": "auto",
"model.images.image_1": [
"1",
0
],
"model.number_of_images": 1,
"model.resolution": "1K",
"prompt": "Change the style into watercolor, maintain character and background identity",
"seed": 1050327575
},
"_meta": {
"title": "Grok Image Edit"
}
},
"27": {
"class_type": "SaveImage",
"inputs": {
"filename_prefix": "ComfyUI-watercolor",
"images": [
"26",
0
]
},
"_meta": {
"title": "Save Image"
}
},
"45": {
"class_type": "GrokImageEditNodeV2",
"inputs": {
"model": "grok-imagine-image-quality",
"model.aspect_ratio": "auto",
"model.images.image_1": [
"1",
0
],
"model.number_of_images": 1,
"model.resolution": "1K",
"prompt": "Change the style into pixel art, maintain character and background identity",
"seed": 2140144728
},
"_meta": {
"title": "Grok Image Edit"
}
},
"46": {
"class_type": "SaveImage",
"inputs": {
"filename_prefix": "ComfyUI-pixel_art",
"images": [
"45",
0
]
},
"_meta": {
"title": "Save Image"
}
}
})
# Replace each example.com URL with a public URL of your file.
workflow.set_input("1", "image", client.assets.from_url("https://example.com/replace-with-a-url/image"))
# run() also passes api_key to the partner nodes in this workflow.
job = client.run(workflow, api_key=api_key)常见问答
Duplicate or delete GrokImageEditNodeV2 → SaveImage branches as needed. Each branch represents one style prompt. Keep filename prefixes unique to prevent overwriting.
If your GrokImageEditNodeV2 relies on an external Grok service, you may need to configure credentials in the node or its settings. Check the node’s documentation or the node UI for any required keys or endpoints.
Use more or less assertive language in your prompt (e.g., "subtle film grain" vs. "heavy grain, high contrast"). If the node exposes a strength or similar control in your setup, lower it for gentler edits and raise it for bolder changes.
Overlapping style terms can converge to similar looks. Make prompts more distinctive, avoid repeating the same base descriptors, and vary seeds if available. Ensuring the input image has clear subject/background separation can also help.