--- name: imagegen-openwebui description: Runbook for running high-quality local image generation via Open WebUI imagegen API endpoint. --- # Open WebUI Image Generation Runbook ## Overview Use this procedure to generate images locally using the Open WebUI image generation endpoint. This approach leverages local ComfyUI integration configured in Open WebUI. ## Endpoint POST to the imagegen endpoint of your Open WebUI instance. ### Example Request ```python import requests url = "http://:/api/images/generations" headers = {"Authorization": "Bearer "} data = { "model": "imagegen", "prompt": "A desired image description.", "n": 1, "size": "1024x1024" } response = requests.post(url, headers=headers, json=data) ``` ### Example Response Returns an object with base64-encoded image data or a URL. ## Best Practices - Keep prompts descriptive for best results. - Use the default model unless configured otherwise. - Verify that ComfyUI is running and connected before invoking. - Check Open WebUI logs for troubleshooting if generation fails. ## Common Issues - **Connection refused**: Ensure Open WebUI and ComfyUI are running. - **Timeout errors**: Large image sizes may take longer; check ComfyUI resources. - **Authentication errors**: Verify API token validity in the request headers.