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
- ファイル
- コードによって URL からアップロードされます
有料の 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.