tools / image_gen.py
Stable Diffusion XL image generation routed to an external GPU node.
Tool: image_generation
Auto-registered when context.llm_client.image_gen_clients exists.
- Heals missing prompt by checking related kwargs (
image,description,subject,text). - Clamps
stepsto[4, 8](Lightning models hate longer schedules). - Calls
llm_client.generate_image({"prompt", "steps"}). - Decodes base64 PNG, writes to sandbox as
gen_UUID.png. - Returns markdown embed:

Backend topology and SDXL model config: image-gen server.