#image generation with comfy

1 messages · Page 1 of 1 (latest)

timid socket
#

I am trying the config for comfyUI from here: https://docs.openclaw.ai/providers/comfy , but following config fails: "models": {
"mode": "merge",
"providers": {
"comfy": {
"mode": "local",
"baseUrl": "http://127.0.0.1:8188",
"image": {
"workflowPath": "./workflows/image.json",
"promptNodeId": "6",
"outputNodeId": "9",
},
}, ------------ ilkeraktuna@ilkers-Mac-mini ~ % openclaw models list --provider comfy
Invalid config at /Users/ilkeraktuna/.openclaw/openclaw.json:\n- models.providers.comfy.models: Invalid input: expected array, received undefined

  • models.providers.comfy: Unrecognized keys: "mode", "image"

🦞 OpenClaw 2026.4.5 (3e72c03) — I can't fix your code taste, but I can fix your build and your backlog.

Config invalid
File: ~/.openclaw/openclaw.json
Problem:

  • models.providers.comfy.models: Invalid input: expected array, received undefined
  • models.providers.comfy: Unrecognized keys: "mode", "image"

Run: openclaw doctor --fix
ilkeraktuna@ilkers-Mac-mini ~ %

#

@runic pagoda

timid socket
#

@runic pagoda will you help ?

timid socket
#

ananın amı krill

timid socket
#

@runic pagoda

timid socket
#

@runic pagoda

runic pagodaBOT
#

Let me check the local docs and source, this smells like a docs/config schema mismatch rather than your JSON being wildly off.

#

Your config shape is actually fine.

mode, baseUrl, and image.workflowPath/promptNodeId/outputNodeId are valid for the bundled comfy plugin per the docs and plugin manifest: https://docs.openclaw.ai/providers/comfy

That error usually means the comfy plugin is not loading, so OpenClaw falls back to the generic provider schema and expects models: [...] instead.

I’d try this in order:

openclaw update
openclaw plugins inspect comfy
openclaw plugins doctor

What you want from inspect comfy is something like Status: loaded.

So, short version:

#

If it still fails after updating, paste these:

openclaw plugins inspect comfy
openclaw plugins doctor
openclaw status --all

and I’ll help untangle the rest.

timid socket
#

the output of these commands are below. but I'd like to emphasize , I did not do any plugin config on openclaw.json . I made the config under "providers" section as described in the docs. ilkeraktuna@ilkers-Mac-mini ~ % openclaw update
Updating OpenClaw...

|
o ✓ Updating via package manager (28.33s)
|
o ✓ Running doctor checks (34.29s)

Update Result: OK
Root: /opt/homebrew/lib/node_modules/openclaw
Before: 2026.4.21
After: 2026.4.21

Total time: 62.88s

Updating plugins...
No plugin updates needed.

Restarting service...
Gateway service not loaded.
Start with: openclaw gateway install
Start with: openclaw gateway
Start with: launchctl bootstrap gui/$UID ~/Library/LaunchAgents/ai.openclaw.gateway.plist
I went away and came back smarter. You should try it sometime.
ilkeraktuna@ilkers-Mac-mini ~ %
ilkeraktuna@ilkers-Mac-mini ~ % openclaw plugins inspect comfy
Invalid config at /Users/ilkeraktuna/.openclaw/openclaw.json:\n- models.providers.comfy.models: Invalid input: expected array, received undefined

  • models.providers.comfy: Unrecognized keys: "mode", "image"

🦞 OpenClaw 2026.4.21 (f788c88) — Welcome to the command line: where dreams compile and confidence segfaults.

Config invalid
File: ~/.openclaw/openclaw.json
Problem:

  • models.providers.comfy.models: Invalid input: expected array, received undefined
  • models.providers.comfy: Unrecognized keys: "mode", "image"

Run: openclaw doctor --fix
u0m% ilkeraktuna@ilkers-Mac-mini ~ %

runic pagodaBOT
#

I dug a bit deeper into the validator path, because your follow-up is important: you’re right, this is supposed to work from models.providers.comfy, not from plugins.entries.

#

I’m going to sanity-check this against the installed package too, because if it reproduces there, then this is pretty clearly a validator bug rather than a config mistake on your side.

#

You’re right, and I think my earlier “plugin not loading” guess was off.

Your models.providers.comfy shape is correct per the docs and the bundled comfy manifest at https://docs.openclaw.ai/providers/comfy. You should not need a plugins config block for this.

What’s happening is a validator bug/mismatch:

  • src/config/validation.ts runs OpenClawSchema.safeParse(raw) first
  • src/config/zod-schema.core.ts still treats every models.providers.* entry like the generic ModelProviderSchema
  • that generic schema requires models: [...] and rejects extra keys like mode and image
  • meanwhile the actual Comfy plugin manifest and runtime expect models.providers.comfy.mode, image, video, music, etc.

So this is why you get:

  • models.providers.comfy.models: Invalid input: expected array, received undefined
  • models.providers.comfy: Unrecognized keys: "mode", "image"

Short version:

#
  • your config is fine
  • docs are describing the intended shape
  • OpenClaw validation is rejecting it before the Comfy-specific schema/runtime gets a chance

Also, one more thing: openclaw plugins inspect comfy failing here does not prove the plugin is missing, because config validation happens before that command can run.

And openclaw models list --provider comfy is probably a bad verify step for this provider anyway, because Comfy is a media-generation provider, not a normal chat-model catalog.

So I’d treat this as a real bug and file it here:
https://github.com/openclaw/openclaw/issues

If you want, I can draft the issue text for you in one pasteable block.

timid socket
runic pagodaBOT
#

Nice, thanks for filing #70345.

Short answer, no, the plugin config path I mentioned earlier will not make Comfy work right now.

Why:

  • plugins.entries.comfy.config and models.providers.comfy are different config surfaces
  • the Comfy runtime in extensions/comfy/workflow-runtime.ts reads only cfg.models.providers.comfy
  • so even if plugins.entries.comfy.config validates, the runtime would ignore it

So there is not a real config-only workaround in openclaw.json at the moment.

If you need it right now, the practical options are:

  1. Local source/install patch (fastest real workaround)
  2. Wait for upstream fix
#

The smallest patch is basically: relax the generic models.providers.* validation so comfy can pass through, because right now ModelProviderSchema is forcing models: [...] and rejecting mode / image.

If you want, I can sketch the minimal patch for 2026.4.21 so you can run it locally until the real fix lands.

timid socket
#

ok. let's do it. but models.provider.comfy not only requires "models" but also denies "image" and "mode" keys. And without the "image" key , openclaw can not find the workflow (I presume) will you be able to provide a working fix

runic pagodaBOT
#

Yes, for a temporary local hack, I’d do this instead of trying plugins.entries.comfy.config.

Your read is correct: if image / mode are stripped or blocked, Comfy cannot resolve the workflow. So the workaround is to relax the provider validator, not move the config.

Temporary working fix

In the built file under your install root (/opt/homebrew/lib/node_modules/openclaw), find the zod-schema.core-*.js file in dist/.

Look for this:

const ModelsConfigSchema = z.object({
  mode: z.union([z.literal("merge"), z.literal("replace")]).optional(),
  providers: z.record(z.string(), ModelProviderSchema).optional()
}).strict().optional();
#

Replace it with this:

const ModelsConfigSchema = z.object({
  mode: z.union([z.literal("merge"), z.literal("replace")]).optional(),
  providers: z.record(
    z.string(),
    z.union([
      ModelProviderSchema,
      z.record(z.string(), z.unknown())
    ])
  ).optional()
}).strict().optional();

Why this works

#

That change keeps normal providers working, but also allows models.providers.comfy to pass through with:

  • mode
  • image
  • video
  • music
  • workflow keys

Then the Comfy runtime can read cfg.models.providers.comfy normally.

Keep your config like this

{
  models: {
    mode: "merge",
#
    providers: {
      comfy: {
        mode: "local",
        baseUrl: "http://127.0.0.1:8188",
        image: {
          workflowPath: "./workflows/image.json",
          promptNodeId: "6",
          outputNodeId: "9",
        },
      },
    },
  },
  agents: {
    defaults: {
      imageGenerationModel: {
#
        primary: "comfy/workflow",
      },
    },
  },
}

Important caveat

This is a temporary validation bypass, and it loosens validation for all models.providers.* entries, so I would only use it until the real fix lands.

Also, I would not trust openclaw models list --provider comfy as the verification step here. Better to test actual image generation after patching.

If you want, I can also give you the TypeScript source patch version for src/config/zod-schema.core.ts, which is cleaner if you’re running from source.

timid socket
#

ok where should be the "workflows" folder for this config to work: workflowPath: "./workflows/image.json", ?

runic pagodaBOT
#

workflowPath: "./workflows/image.json" is not resolved relative to ~/.openclaw/openclaw.json.

It is resolved relative to the current working directory of the OpenClaw process.

So:

  • if you run openclaw from ~, then ./workflows/image.json means ~/workflows/image.json
  • if the gateway service is running it, the working directory may be different

So the safest thing is to use either:

workflowPath: "/Users/ilkeraktuna/workflows/image.json"

or

#
workflowPath: "~/workflows/image.json"

I would not rely on ./workflows/... here, especially with the gateway/service path.

So yes, your presumption was right, if OpenClaw can’t see the image config and the resolved workflow file, it won’t find the workflow.

timid socket
#

and how should the workflow.json look like ? on comfyUI I have options to "export" and "export (api)" , also some externally written comfy skills look for a "prompt" key at the beginning of the json. which of the 3 alternatives are working with internal comfy model ?

runic pagodaBOT
#

For the bundled/internal Comfy provider, use Export (API).

That is the one that should work.

What OpenClaw expects

Your workflow.json should be the raw Comfy prompt graph object, with node IDs at the top level, something like:

{
  "6": {
    "inputs": {
      "text": ""
    },
    "class_type": "CLIPTextEncode"
  },
#
  "9": {
    "inputs": {
      "images": ["8", 0]
    },
    "class_type": "SaveImage"
  }
}

What not to use

  • Export: usually the UI/workflow format, not the API prompt format, so I would not use that here
  • a file that starts with top-level "prompt": also not for OpenClaw

Why: OpenClaw already wraps your workflow when it submits to ComfyUI, basically like this:

#
{
  "prompt": { ...your workflow json... }
}

So if your file already has a top-level "prompt" key, it gets wrapped wrong.

Short answer

  • Use: Export (API)
  • Do not use: Export
  • Do not use: { "prompt": ... } as the file content

Then set:

  • promptNodeId to the node that receives text
#
  • outputNodeId to the node whose output you want OpenClaw to read

If you want, paste a small redacted Export (API) JSON here and I can tell you which node IDs should be promptNodeId and outputNodeId.

timid socket
#

it works. thank you

runic pagodaBOT
#

Glad it works 🎉

One small note, since this is a temporary local patch, I’d remove it once the real fix for #70345 lands.

If this fixed it, please right-click the solution message → Apps → ✅ Mark Solution. That helps Answer Overflow index it for the next person who hits the same Comfy issue.

timid socket
#

I have one additional question; now the agent can generate images , but by default it can not send me the generated image through whatsapp or the web UI. How can I make an integration so it could send me the generated image ? a plugin ? or internal/external skill ?

#

@runic pagoda

#

?

runic pagodaBOT
#

Short answer: not a plugin, not a skill.

For built-in image generation, OpenClaw is already supposed to do this:

  • image_generate outputs are auto-delivered as media attachments
  • WhatsApp already supports outbound media
  • WebChat is an internal channel, not a separate outbound plugin target

Docs/source match that:

What this means in practice

WhatsApp

#
  • This should work out of the box
  • If generated images are not arriving there, that is more likely a delivery bug/config issue than “missing integration”
  • One config worth checking is channels.whatsapp.mediaMaxMb, but normally images should send fine

Web UI / WebChat

  • This one looks more like a current product limitation
  • The current WebChat assistant-media path in source only inlines image blocks for data:image/... URLs
  • Generated images are usually file-backed/OpenClaw-managed attachments, so they may not render in WebChat today the same way they do on external channels

My recommendation

  1. Do not build a custom plugin/skill for this
  2. Treat WhatsApp non-delivery as a bug / delivery-path issue
  3. Treat WebChat image display as a current limitation/gap
  4. If you want, file a GitHub issue with:
    • OpenClaw version
    • channel used (whatsapp / web UI)
#
  • whether the image file is generated successfully
    • whether normal manual media sends work, but generated-image replies do not

If you want, I can help you write a minimal reproducible bug report for both cases.

#

Yep, I’m here 🦐

One fast way to split this:

  • If manual WhatsApp media send works, but agent-generated image replies do not, it’s a reply/delivery bug
  • If manual WhatsApp media send also fails, it’s a channel/media config issue
  • Web UI/WebChat still looks like a current limitation for file-backed generated images

So I’d test exactly this:

  1. generate an image
  2. send that same file manually via the message tool / normal outbound media path
  3. compare behavior

If you want, I can help you turn that into a tiny reproducible report for GitHub.