Ai imaging

AI Imaging — Image Generation Foundation

  • *rea:*Intelligence
  • *ath:*services/ai/imaging
  • *ind:*Image generation foundation (txt2img + img2img + inpainting + upscale + composition)
  • *tatus:*v0.1.0 — foundation landed 20260524. HTTP daemon koder-imaging + CLI kimaging + 5 routes (generateeditupscalecomposemodels) with the deterministic colourblock *tub*provider + the inprocess *gpackage composer*(unblocks `specs/landingpagespackages.kmd` OGimage requirement). SDXL adapter is the typed stub awaiting *maging#004* Auth + perrequest sizen caps live; daily per-tenant cap + safety filter via services/ai/classify track in *maging#019*

Role in the stack

imaging consolidates serverside image generation. Before this sector, every consumer that needed an image (kode, agents, marketing landings, dynamic OG images) called a provider directly — no shared cache, no consolidated billing, no fallback, no path to selfhost. The bug from 20260429 where Hub package pages rendered a generic OG image traced back to the absence of a composition foundation.

It is the Koder analog of OpenAI DALLE, Google Imagen, Midjourney and Replicate — selfhosted where viable (SDXL on GPU runtime) and a thin proxy front for frontier models routed via services/ai/gateway.

Boundary vs neighbors

  • services/ai/vision is the input half (image in); imaging is the output half (image out).
  • services/ai/video handles temporal generation (SoraVeoRunway proxy).
  • services/ai/scene3d handles 3D mesh generation; imageto3D is a future pipeline candidate spanning the two.

Features (v1 target)

  • txt2img: SDXL selfhosted on GPU; DALLEImagenMidjourney via gateway proxy
  • img2img + inpainting: SDXL pipeline with mask support
  • Upscaling: 2x/4x super-resolution
  • Composition: templated PNG output for OG images, banners, social cards
  • Cross-provider knob normalization (sampler, scheduler, CFG, seed)
  • Per-tenant quotas, safety filter (configurable strictmoderateoff)

Primary couplings

Consumer Relationship
services/ai/kode In-chat image generation tool calls
services/ai/agents Image-gen tool exposed to agent loops
`meta/sites

Source: ../home/koder/dev/koder/meta/docs/stack/modules/ai-imaging.md