{% extends "admin/_layout.html" %} {% from "_macros.html" import icon %} {% set section = "images" %} {% block title %}Image generation - {{ brand.name }}{% endblock %} {% block heading %}Image generation{% endblock %} {% block admin_content %}

Lets a model draw a picture and show it in the conversation, on a ComfyUI you are running. It is offered as a tool the model chooses to call, so nothing changes for a conversation that never asks for one — and it is only offered once there is a ComfyUI, a workflow and at least one checkpoint, because a tool that fails on its first call is worse than a tool nobody was given.

{% if saved %}
{{ icon("check", "icon--sm") }} {{ saved }}
{% endif %}

Image generation {% if values.enabled %}on {% else %}off{% endif %}

Who may use it is a permission — tools.image under Groups & permissions. Which models may is a checkbox on each model.

ComfyUI

Where ComfyUI is listening. An address on this machine or this network is fine here and is not checked against the request-forgery rules — you typed it, unlike an address a model asks for.

{% if values.api_key_encrypted %} Currently {{ masked }}. Leave the dots alone to keep it, or clear the field to remove it. {% else %} Only needed if something sits in front of ComfyUI. Encrypted at rest. {% endif %}

How long to wait for one image, queue included. Far longer than any other timeout here, because the thing being waited for genuinely takes that long.

Checkpoints

One filename per line, exactly as ComfyUI spells it. This is the list the model chooses from, so leaving out a checkpoint is how you stop it being used. Press Test below to read them off ComfyUI — that fills this in the first time and never overwrites it afterwards.

What a generation uses by default

What every picture is drawn with unless the model names otherwise. Leave a box empty to use the built-in value shown beside it — the built-ins are SD1.5-era, and 512×512 on an SDXL checkpoint is what produces the duplicated limbs.

{# A select rather than a box, from the list above. Typing a name that is not there produced a picture drawn with whatever happened to be first, with nothing anywhere saying so. #}
{# The five sizes anybody actually picks. Buttons rather than a select because they set two fields at once, and a select of pairs would have to name every combination somebody might want. #}
{% for label, w, h in [ ("512²", 512, 512), ("768²", 768, 768), ("1024²", 1024, 1024), ("1024×1536", 1024, 1536), ("1536×1024", 1536, 1024) ] %} {% endfor %}
{# From what the Test button read off ComfyUI. There are forty-odd and spelling one wrong is a refused workflow, so it is picked rather than typed — and the current value is kept as an option even when the list has not been read, or saving this page would quietly clear it. #}
{% if not values.samplers %}

Press Test & read what it has above to fill the sampler and scheduler lists from your ComfyUI.

{% endif %}

Used when the model does not write one of its own. It writes one often, so this is a floor rather than something always applied — “always add these words” belongs in the instructions below, where the model is told to include them.

Checking the result

A vision model is shown the picture and the request it came from, and says keep or retry. Only clearly wrong images are retried — a missing subject, a mangled picture — because taste is not a fault and the next attempt is not promised to be better. The reader sees only the image that was kept.

Only models marked as having vision are listed. If there is nothing to ask, the first image is kept and nothing fails.

Including the first. The last attempt is kept whatever the review says, so a request always produces a picture.

Memory

For a machine that cannot hold both at once. Before generating, the chat's own connection is asked to unload — set an unload URL on it under Connections, or nothing happens. Afterwards ComfyUI is asked to free its own models, and the language model loads again by itself on the next request.

{% if values.preserve_vram and values.review_enabled %}
{{ icon("warning", "icon--sm") }} Both are on, so every retry costs two model loads — one to review, one to generate again. That is the slow combination; consider two attempts rather than {{ values.max_tries }}.
{% endif %}

Extra instructions

Added to what every model is told about image generation, on this instance. Where “always put text, watermark in the negative prompt” lives. Leave it empty and nothing is added at all.

Workflows

A workflow is a ComfyUI graph exported with Export (API), with {{ '{{prompt}}' }} and the other placeholders where the values go. The model picks between them by their descriptions, so write the description for a reader who cannot see the graph.

{{ icon("plus", "icon--sm") }} Add a workflow
{% if not workflows %}
{{ icon("image", "empty__mark") }}

No workflows yet. One is needed before anything can be drawn; the default one is filled in for you when you add the first.

{% else %}
{% for item in workflows %}
{{ item.name }} {% if not item.enabled %}disabled{% endif %} {% if values.default_workflow_id == item.id %} default {% endif %} {{ item.slug }} {% if item.description %}

{{ item.description }}

{% endif %}
{% endfor %}
{# Every other value is resubmitted with it, because this posts to the same handler as the form above and an absent field reads as cleared. #}

Used when the model names no template and the chat has no preference.

{% endif %}
{% endblock %}