Skip to content

Setup: ComfyUI

TomoriBot can generate images and videos through your own ComfyUI instance. It drives ComfyUI by submitting an API-format workflow with your prompt/size substituted in, then polls ComfyUI’s /history endpoint until the output is ready.

This guide covers installing/running ComfyUI and registering it. For authoring or editing a TomoriBot-compatible workflow (the {TOMORI_*} placeholders), use the workflow README on GitHub.

Image and video generation is GPU-bound: the heavy cost is VRAM (your graphics card’s memory, separate from system RAM), determined by the model checkpoint your workflow loads. An NVIDIA GPU is strongly recommended. The two workflows TomoriBot ships need:

Bundled workflowBase modelPractical VRAMNotes
Anima turbo (image)Anima Turbo v1.1 (2B), bf16~8 GB workable · 12 GB+ comfortableThe 4.2 GB model plus a 1.2 GB text encoder, at 10 steps plus a short 2x upscale pass. A character reference adds about half again to generation time.
Anima detailed (image)Anima Aesthetic v1.1 (2B), bf16~8 GB workable · 12 GB+ comfortableSame memory as turbo, but 30 steps plus face and hand detailers, so several times slower per image. Other Anima models are in the model folder; the workflow README covers switching.
WAN i2v loop (video)Wan 2.2 14B, fp8 + 4-step LightX2V LoRAs~16 GB workable · 24 GB+ comfortableHeaviest option expect minutes per clip. Offload the UMT5 text encoder to RAM (t5_cpu, needs 24 GB+ system RAM) on smaller cards.

The Wan checkpoint is already fp8-quantized to fit consumer cards. If you have less VRAM, swap the UNET for a smaller quant and enable ComfyUI’s --lowvram / CPU offload. CPU-only diffusion is impractical (many minutes per image, worse for video) and can exceed TomoriBot’s poll window, so a GPU is effectively required for regular use.

Install ComfyUI per its README and start it so it listens on the network:

Terminal window
python main.py --listen 0.0.0.0 --port 8188

--listen 0.0.0.0 matters if TomoriBot runs in Docker or on a different machine: the default binds to loopback only. Confirm reachability from the machine the bot runs on:

Terminal window
curl http://127.0.0.1:8188/system_stats

If you want to test, load the model checkpoints your chosen workflow expects and do one manual generation in the ComfyUI web UI to confirm it works end to end before wiring up TomoriBot.

Download a ready-to-use API-format workflow. Examples can be found in the repo under assets/comfyui-workflows/:

WorkflowModes
Anima turbo (image, fast) : tomoribot-anima-image-turbo.jsontext to image, character reference, inpaint/outpaint
Anima detailed (image, slower, face and hand detailers) : tomoribot-anima-image-detailed.jsontext to image, character reference, inpaint/outpaint
MOSS standard (image, prompt rewritten by a multimodal encoder) : tomoribot-moss-image.jsontext to image, character reference
MOSS detailed (image, slower, 2x upscale with face and hand detailers) : tomoribot-moss-image-detailed.jsontext to image, character reference
WAN i2v loop (video) : tomoribot-wan-i2v-loop-video.jsonimage-to-video

Each workflow needs specific custom nodes and model files in specific ComfyUI folders. The workflow README lists them for the Anima and MOSS workflows, with download links and the folder each file goes in. Install those before registering, or generation fails with a missing node or Value not in list error.

These are API format (the JSON ComfyUI exports via Save (API Format)), not the regular UI-save format. If you author your own, it must contain the {TOMORI_*} placeholders TomoriBot substitutes (prompt, width/height, seed, reference images, etc.). See the workflow README and the Custom Endpoints page under Providers in /help.

Run /providers (or /personal providers), choose Add New Custom Endpoint, and enter:

FieldValue for ComfyUI
endpoint_labelA name you choose, e.g. home-comfy
API CompatibilityComfyUI
endpoint_urlhttp://127.0.0.1:8188 (root, without /v1)
auth_token(leave blank unless your ComfyUI is behind auth)

After saving the connection, select it and choose + Add new Image Model or + Add new Video Model from the model dropdown. Enter the checkpoint’s exact code name and upload the workflow .json downloaded from Step 2 into ComfyUI Workflow. The model capability must match the workflow (image workflow → image, video workflow → video).

For the Anima workflows, tick Text to image, Reference image, and Inpainting under Image Capabilities. Reference image is what lets Tomori draw a user or persona from their character reference.

Adding the model makes it the active image/video model automatically. Trigger generation by asking Tomori directly in chat. If it isn’t active for some reason, run /config > Models > Switch Models and select your registered ComfyUI endpoint.

  • Unreachable on add: ComfyUI bound to loopback while the bot is in Docker / on another host. Start it with --listen 0.0.0.0 and use http://host.docker.internal:8188 or the LAN IP.
  • Generation never completes: TomoriBot polls /history until the output appears. Cold starts and large models on CPU can exceed the poll window.
  • Prompt/size ignored or wrong output size: the workflow is missing the required {TOMORI_*} placeholders, or you uploaded a UI-format export instead of API format.
  • Missing node or Value not in list: a custom node pack or model file from the workflow README is not installed, or a model file was renamed. Install it, restart ComfyUI, and try again. You don’t need to re-upload the workflow.
  • Wrong capability: an image workflow registered under video (or vice-versa) won’t run. Re-add it under the matching capability.