Skip to content

Image generation

The Image Generation card adds image generation to Bonsai, set up as on the NixAI host. It is off until installed. Install needs Bonsai set up and a card with 11 GB or more, the smallest Bonsai itself runs on. It downloads about 19.3 GB, verifies every file against its pinned SHA-256, unpacks ComfyUI with Windows’ tar, precompiles it and restarts the service. Remove deletes only these files and restarts the service; Bonsai stays.

  • Model: NixAI’s Qwen Image 2.1 Turbo preset: the INT8 transformer (7.3 GB) and VAE (0.7 GB) from Comfy-Org/Qwen-Image-2.1 and the Heretic INT8 Qwen3-VL text encoder (9.4 GB), eight steps, CFG 1. The person downloads the weights from Hugging Face; Qwen Image 2.1 is under the Qwen research licence, for non-commercial use, and the card says so.
  • Server: ComfyUI 0.43.0 portable for NVIDIA (2.0 GB, GPL-3.0) in runtime-image-v0.43.0\. Its base directory, with the models, input and output, is image\; NixAI’s workflow is image-workflow.json.
  • One port: with image generation installed the service itself answers port 18187, with NInfer on 18189 and ComfyUI on 18190, both private. There is no image provider, model or endpoint in Synoec: Bonsai’s Connection says it makes images, so a chat on Bonsai gets GenerateImage through the compatible image tool. The service answers NixAI’s /v1/images/generations and /v1/images/edits, and, for Prefer: respond-async, 202 jobs at /v1/images/jobs/<id>.
  • Taking turns: a render waits for Bonsai’s replies, asks NInfer to suspend Bonsai and waits until it reports asleep. The next Bonsai message waits for the render, has ComfyUI free its memory, and loads Bonsai again. ComfyUI starts with the first render and stays running, as on NixAI.
  • Memory on Windows: Windows counts graphics memory against commit (RAM plus page file). ComfyUI reads its models from their files without pinning RAM. When less than 20 GiB of commit is free for a render, Bonsai is unloaded rather than suspended, so its next reply reads the chat again; when less than 24 GiB is free as Bonsai takes the card back, ComfyUI ends and the next render starts it again (15–18 s). A larger page file keeps both faster.
  • What a chat can ask for: a square, landscape or portrait picture, a transparent or opaque background, and an edit of a picture already in the conversation, one picture at a time. An edit can take a mask: wherever the mask is transparent the render replaces the picture, and everything else is kept, as the OpenAI image API defines it. A mask with no alpha channel is refused, since it would mark nothing. Attach the mask to the chat beside the picture, and mask the whole object you want changed: the masked area is filled from a fresh render, so masking part of one leaves a visible join.
  • A failed render gives Bonsai’s request slot back, so the chat goes on.
  • Smaller cards render the same pictures a little more slowly: ComfyUI reads the weights from their files as it needs them. Measured on the build VM with memory held back, so the card really had less free: a 1024 x 1024 render took 12.2 s then 6.0 s with 15.2 GB free, and 12.1 s then about 10 s with 11.1 and 10.1 GB free. That is one card held back, not smaller hardware.
  • Measured on the build VM’s RTX 3090 Ti (2026-11-13), installed from the card: download 31 minutes at about 10 MB/s; in a Bonsai chat a picture took 1 m 17 s, an edit of it 1 m 16 s and a plain question after 33 s; warm renders by hand 4.1 s at 768 x 768.