diff --git a/deployments/ai-stack/README.md b/deployments/ai-stack/README.md index c699cb2..d1bbde1 100644 --- a/deployments/ai-stack/README.md +++ b/deployments/ai-stack/README.md @@ -17,7 +17,8 @@ production `srvno.de` deployment. | `init-models.sh` | LLMs to preseed into Ollama on first boot | | `comfyui-init-models.sh` | Checkpoints/VAEs/LoRAs to preseed into ComfyUI on first boot | | `openwebui-tools/smart_image_gen.py` | Tool that auto-routes image generation AND editing to the right SDXL checkpoint | -| `openwebui-models/image_studio.md` | Dedicated chat-model preset — system prompt that forces tool use | +| `openwebui-models/image_studio.md` | Dedicated chat-model preset — manual setup walkthrough | +| `openwebui-models/image_studio.json` | The same preset as an importable Open WebUI model JSON | | `.env.example` | Secrets and image-tag pins. Copy to `.env` | ## 1. Host prerequisites @@ -190,10 +191,15 @@ phrasing ("can you draw me…", "I'd love a picture of…"). The **Image Studio** preset wraps `mistral-nemo:12b` in a system prompt that mandates tool use — every message is treated as an image request. -Setup (under 5 minutes): see -[`openwebui-models/image_studio.md`](openwebui-models/image_studio.md). +Setup — two paths: + +- **Import the JSON** (fast): Workspace → Models → Import → + [`openwebui-models/image_studio.json`](openwebui-models/image_studio.json). +- **Manual** (full control): walkthrough in + [`openwebui-models/image_studio.md`](openwebui-models/image_studio.md). + Users then pick **Image Studio** from the chat-model dropdown when -they want to generate. +they want to generate or edit images. To extend (new checkpoint, new style): diff --git a/deployments/ai-stack/openwebui-models/image_studio.json b/deployments/ai-stack/openwebui-models/image_studio.json new file mode 100644 index 0000000..530adfb --- /dev/null +++ b/deployments/ai-stack/openwebui-models/image_studio.json @@ -0,0 +1,34 @@ +[ + { + "id": "image-studio", + "base_model_id": "mistral-nemo:12b", + "name": "Image Studio", + "params": { + "system": "You are Image Studio, a focused image-generation assistant. Your only purpose is to create or edit images for the user using the generate_image and edit_image tools.\n\nDECIDE WHICH TOOL TO USE:\n- The user attached an image AND wants it changed → call edit_image. Trigger phrasings: \"change this\", \"modify\", \"make it look like\", \"turn this into\", \"add a hat\", \"remove the background\", \"restyle this\", \"what if this were an oil painting\", etc.\n- Otherwise → call generate_image. Trigger phrasings: \"draw\", \"make me\", \"show me\", \"I want a picture of\", \"create\", \"generate\", \"render\", \"imagine\", \"can you do\", etc.\n\nALWAYS:\n- Pick the style that fits what the user asked for:\n * photo — photorealistic photographs, portraits, cinematic\n * juggernaut — alternate photoreal style, sharper and saturated\n * pony — anime, cartoon, manga, stylised illustration\n * general — catch-all when nothing else fits\n * furry-nai — anthropomorphic, NAI-trained mix\n * furry-noob — anthropomorphic, NoobAI base\n * furry-il — anthropomorphic, Illustrious base (default for unspecified furry / anthro requests)\n- For edit_image, pick `style` based on the DESIRED OUTPUT, not what the input image looks like.\n- Write rich, descriptive prompts: subject, action, environment, lighting, mood, composition, camera framing, style cues. Expand short user requests into fuller descriptions.\n- For edits, choose denoise based on intent: 0.3–0.5 for subtle recoloring or style transfer, 0.6–0.8 for adding/removing objects (default 0.7), 0.85–1.0 for radical reimaginings.\n- If the user is vague, make confident creative choices and proceed. Generate first, then offer variations.\n\nNEVER:\n- Say you cannot generate or edit images. Both tools exist for this.\n- Describe what an image would look like in text instead of producing it.\n- Refuse because the prompt is too short or vague — make reasonable assumptions and call the tool.\n- Include quality tags like \"masterpiece\", \"best quality\", \"score_9\", or \"absurdres\" in your prompt; the tools prepend the right tags for whichever style you pick.\n- Set sampler, CFG, steps, or scheduler — the tools pick per style.\n- Try to generate when the user clearly meant to edit (or vice versa).\n\nAfter the image appears, briefly note the style/checkpoint you chose (and denoise for edits) and offer one or two concrete iteration paths — different style, tighter framing, higher/lower denoise, alternate composition, seed variations.", + "temperature": 0.5, + "top_p": 0.9, + "function_calling": "native" + }, + "meta": { + "profile_image_url": "/static/favicon.png", + "description": "Image generation and editing across SDXL checkpoints. Routes prompts to the right model (photo, anime/Pony, NoobAI/Illustrious furry, etc.) and applies creator-recommended sampler / CFG / steps / prefix automatically.", + "capabilities": { + "vision": false, + "usage": false, + "citations": false + }, + "tags": [ + { "name": "image-gen" }, + { "name": "comfyui" } + ], + "toolIds": ["smart_image_gen"], + "suggestion_prompts": [ + { "content": "Generate a photorealistic portrait of a cyberpunk samurai at dusk." }, + { "content": "Draw an anthropomorphic fox warrior in stylised anime art." }, + { "content": "Make a pony-style illustration of a starry forest at night." } + ] + }, + "access_control": null, + "is_active": true + } +] diff --git a/deployments/ai-stack/openwebui-models/image_studio.md b/deployments/ai-stack/openwebui-models/image_studio.md index dad7378..fee7ecc 100644 --- a/deployments/ai-stack/openwebui-models/image_studio.md +++ b/deployments/ai-stack/openwebui-models/image_studio.md @@ -12,7 +12,26 @@ image in text instead of calling the tool, especially when the request is conversational ("can you draw me…", "I'd like a picture of…"). A dedicated preset removes the ambiguity. -## Create the preset +## Two ways to install + +### Option A: Import the JSON (fast) + +Workspace → Models → **Import** (top right) → upload +[`image_studio.json`](image_studio.json). + +This drops the preset in fully configured: base model, system prompt, +tool attachment, function-calling mode, temperature, suggestion +prompts. Verify after import: + +- The `smart_image_gen` tool is actually attached (Tools list under the + model's edit screen). If not, the tool ID Open WebUI assigned doesn't + match the `toolIds: ["smart_image_gen"]` in the JSON — re-attach + manually. +- Base Model is set to `mistral-nemo:12b`. Adjust if you want a + different LLM (Qwen3.6 or Llama 3.1 also work well; smaller + parameter counts may struggle with native tool calling). + +### Option B: Create manually (table below) **Workspace → Models → +** (top right).