Nodes/ComfyUI-YogurtNodes/Image Generation (Custom Model)
ComfyUI Node

Image Generation (Custom Model)

Type a Model ID, See What Bites

By yogurt7771·Created 2 years ago·Updated 6 days ago· 3
Image Generation (Custom Model)
  • images
  • provider
  • image
  • images
  • text
  • thought
◄prompt►
◄model▾►
◄n1►
◄seed0►
◄extra►
◄retry_count1►
◄system_prompt►

The pack ships nice named image nodes - Nano Banana, GPT Image, Seedream, Grok Imagine, Qwen. This isn't one of those. It's the escape hatch for everything else: an image generator with no built-in model list, where you supply the model ID as a string and point it at a provider you also supply.

Three real reasons to use it. The model you want isn't in a dropdown yet (this happens roughly monthly). You're on a relay or gateway whose model names don't match the official ones. Or you want one node to sit in a workflow slot while you swap the endpoint behind it, instead of rewiring a different family node each time.

The mechanism, briefly

The provider node declares which protocols it speaks for the image task - openai_images, ark_images, dashscope_image, grsai_draw, and so on. This node takes that protocol, substitutes the model ID you typed, and sends a request built from the standard image fields (prompt, count, and whichever of aspect_ratio, resolution, size, quality the endpoint tolerates). No model table means no validation, so a typo surfaces as a server error with your string quoted in it. If the provider doesn't declare an image protocol at all, the node stops early and says so.

Inputs worth setting

  • prompt - the generation prompt. On editing models this is also where your instruction goes ("replace the background with a studio backdrop").
  • model - dynamic combo; the Custom model entry reveals model_id plus four optional hint fields: aspect_ratio, resolution (auto/512/1K/2K/4K), size (explicit, like 1024x1024, defaults to auto) and quality. The pack's own tooltips are blunt about these: sent only when the protocol supports it. Leave them at their defaults and the server decides.
  • n - how many images to ask for, 1–10. Prices are per image per call, so this is the money dial.
  • seed - 0 for provider-random; changing a non-zero value forces a re-run.
  • images - autogrow reference input, up to 16, batches expanded. This is what turns a text-to-image call into an edit: connect an image and the reference goes with the prompt. Caps are real - exceed one and the node throws rather than silently dropping.
  • system_prompt - only meaningful on models that accept one; harmless otherwise.
  • extra - JSON merged into the request body, for anything the node doesn't expose.
  • retry_count - total attempts, ~3s apart. Keep at 1 while you're learning a new endpoint's quirks.

Outputs: image (everything as one batch - with a caveat, below), images (a proper list output), text and thought (some models narrate what they did).

Install

cd ComfyUI/custom_nodes
git clone https://github.com/yogurt7771/ComfyUI-YogurtNodes
cd ComfyUI-YogurtNodes
pip install -r requirements.txt

Manager install works too - search "YogurtNodes". Wire a provider node into the provider socket. Important: with the socket empty this node falls back to the pack's default image provider, which is official OpenAI, keyed from api_key.json's openai entry or OPENAI_API_KEY. That fallback is convenient and also how people accidentally bill OpenAI while trying to test a local endpoint.

The batch caveat, and why it matters

The image output batches everything into a single IMAGE tensor - but only if the sizes match. Generate four images at differing aspect ratios and you get the first one. The pack's tooltip says this out loud, which is more than most do. If you're asking for multiple sizes or letting n run free, take the images list output and feed it to a node that iterates, rather than discovering later that three quarters of your output vanished.

Failure modes you'll meet

"Provider does not support custom image models." Your provider declares no image protocol for this task. FreedomGPT and OpenAI-compatible relays are typically fine for chat but have their own story for images; check before assuming.

Model ID accepted by the endpoint but wrong for your account. Some relays expose only a subset of a vendor's models. You'll get a 404 or a 400 naming the model, not a generic failure.

Everything at once. Four images, three retries, one slow relay, and timeout at 0 means ComfyUI just sits there. Set a timeout while you're characterising an unknown endpoint.

Reference images silently ignored. If the model IDs you're using are text-to-image only, the reference inputs are accepted and dropped by the server without complaint. That's a server behaviour, not a node bug.

The honest framing for this whole category: it's how you get models with no open weights into a graph, at a per-call price, with your prompt leaving the machine (the KB's external-api-nodes.md has the full trade-off list). This node's value is not adding capability so much as removing the wait.

CategoryYogurtNodes/LLM/Image

Inputs (9)

NameTypeDefaultDescription
promptSTRINGPrompt sent to the model.
modelCOMBOModel version; the inputs below change with the selected model.
nINT11–10Number of images to generate.
seedINT00–2147483647Sent to the API when the model supports it; changing it also forces a re-run. 0 lets the API pick a random seed.
extraSTRINGOptional JSON object merged into the request (for parameters not exposed as inputs).
imagesCOMFY_AUTOGROW_V3Optional reference image(s); batches are expanded. Up to 16.
retry_countINT11–10Total attempts on failure.
system_promptoptSTRINGSystem instruction sent with the request.
provideroptYOGURT_LLM_PROVIDERProvider node. When unconnected, the official API is used with keys from api_key.json or environment variables.

Outputs (4)

NameTypeDescription
imageIMAGEAll images as one batch (first image only if sizes differ).
imagesIMAGE—
textSTRING—
thoughtSTRING—