1 張圖多風格批次生成
上傳一張圖,15 秒內用 Grok Imagine Quality 產生 12 種風格變化。
關於
本 ComfyUI 教學示範如何用提示詞驅動編輯,將單一圖像快速轉換為 12 種不同風格。流程簡單且快速:LoadImage 匯入來源圖,圖像分流到 12 個 GrokImageEditNodeV2(每個用不同風格提示詞與 Grok Imagine Quality 引擎),每個結果都用 SaveImage 節點分別儲存。這能快速產生風格牆,適合探索、A/B 測試或向客戶展示多種選項。
技術上,流程會將同一張輸入圖像複製到多個平行分支。每個 GrokImageEditNodeV2 根據你設定的風格提示詞(如「水彩素描」、「賽博龐克霓虹」、「棚拍人像修圖」)進行風格轉換,同時保留原圖主體與構圖。SaveImage 節點負責檔名與輸出路徑,確保每個變體獨立儲存。由於每個分支獨立,ComfyUI 可高效排程,Grok Imagine Quality 模型也針對快速一致編輯最佳化——讓你一次就能產生 12 種變化。
您提供的內容
- 正在讀取工作流程
在 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)問答
複製或刪除 GrokImageEditNodeV2 → SaveImage 分支即可。每個分支代表一個風格提示詞。請確保檔名前綴不同,避免覆蓋。
若 GrokImageEditNodeV2 需連外部 Grok 服務,可能需在節點或設定中填寫憑證。請參考節點說明或 UI 相關欄位。
提示詞語氣可強可弱(如「細緻膠片顆粒」vs「重度顆粒、高對比」)。若節點有強度控制,調低為細微變化,調高則風格更明顯。
重複的風格詞會導致結果趨同。請讓提示詞更具區辨性,避免重複描述,並變換種子(seed)。輸入圖像主體/背景分明也有助於風格分化。