Files
llm-router/comfyui-workflow.json
T
Joseph CostaandClaude Opus 4.8 2f95e6be96 Add ComfyUI image generation (/v1/images/generations)
OpenAI-compatible image endpoint that proxies to a ComfyUI server: fills a
workflow template with per-request params (prompt/size/n/seed/steps/checkpoint),
submits to ComfyUI, polls history, fetches images, returns OpenAI image shape.

- router.py: _handle_image + fill_workflow + route; env ROUTER_COMFYUI /
  ROUTER_COMFY_CHECKPOINT / ROUTER_COMFY_WORKFLOW
- comfyui-workflow.json: default SD/SDXL text2img template with {{SENTINELS}}
- docs/IMAGES.md + README: config, usage, custom workflows
- verified: templating + clean error when ComfyUI is down; end-to-end pending
  a live ComfyUI

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-05 03:14:51 -05:00

42 lines
1006 B
JSON

{
"3": {
"class_type": "KSampler",
"inputs": {
"seed": "{{SEED}}",
"steps": "{{STEPS}}",
"cfg": 7,
"sampler_name": "euler",
"scheduler": "normal",
"denoise": 1,
"model": ["4", 0],
"positive": ["6", 0],
"negative": ["7", 0],
"latent_image": ["5", 0]
}
},
"4": {
"class_type": "CheckpointLoaderSimple",
"inputs": { "ckpt_name": "{{CHECKPOINT}}" }
},
"5": {
"class_type": "EmptyLatentImage",
"inputs": { "width": "{{WIDTH}}", "height": "{{HEIGHT}}", "batch_size": "{{BATCH}}" }
},
"6": {
"class_type": "CLIPTextEncode",
"inputs": { "text": "{{PROMPT}}", "clip": ["4", 1] }
},
"7": {
"class_type": "CLIPTextEncode",
"inputs": { "text": "{{NEGATIVE}}", "clip": ["4", 1] }
},
"8": {
"class_type": "VAEDecode",
"inputs": { "samples": ["3", 0], "vae": ["4", 2] }
},
"9": {
"class_type": "SaveImage",
"inputs": { "filename_prefix": "router", "images": ["8", 0] }
}
}