generate_image
Generate AI images or inpaint selected regions as new Krita layers in one undo step from text prompts, references, or control guides.
Instructions
Generate pixels with an image model and place them as NEW layers (one undo step). mode: auto (inpaint if there is a selection, else txt2img), txt2img, img2img (rework the region; strength 0..1 = how much changes), inpaint (regenerate only the selected pixels; soft edges blend). The region is the selection's bounds + padding (or x/y/width/height, or region='canvas'); results are cut to the selection, so nothing outside it changes. count 1-8 = variations in a group plus a numbered comparison sheet (choose with pick_variation). backend: comfyui, a1111, openai, gemini, stability, replicate, fal (default: KRITA_MCP_IMAGE_BACKEND or the first available - see ai_backends). model = checkpoint / model id (Replicate 'owner/name', fal 'fal-ai/...'). size = longest side to generate at (default 1024). workflow = a ComfyUI API-format graph saved as /workflows/NAME.json using {{prompt}} {{negative}} {{seed}} {{image}} {{mask}} {{width}} {{height}} {{strength}} placeholders (ControlNet, IP-Adapter, Flux, ... anything ComfyUI can do). extra = provider-specific inputs. control = guide the composition with a layer, e.g. [{"layer": "Sketch", "type": "lineart", "strength": 0.8}] - paint a sketch / pose / depth layer and the model follows it. type: lineart, scribble, canny, softedge, depth, openpose, normal, seg, tile, ...; model = ControlNet model (default: the first installed whose name contains the type); preprocess = A1111 preprocessor (e.g. depth_midas when the layer is a photo); start/end 0..1; layer omitted = the whole picture. Real ControlNet on comfyui / a1111 (several guides at once; in workflows use {{control}} / {{control_1}}...); stability uses its sketch / structure control; openai and gemini receive the guide as the image to follow. style = a look recipe added to the prompt (with a matching negative prompt): photo, cinematic, portrait, product, fashion, street, landscape, macro, food, architecture, drone (realistic) or concept_art, illustration, anime, watercolor, oil_painting, 3d_render, pixel_art, comic, sketch.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| x | No | ||
| y | No | ||
| cfg | No | ||
| mode | No | auto | |
| name | No | ||
| seed | No | ||
| size | No | ||
| count | No | ||
| extra | No | ||
| model | No | ||
| steps | No | ||
| style | No | ||
| width | No | ||
| height | No | ||
| prompt | Yes | ||
| region | No | auto | |
| backend | No | ||
| control | No | ||
| padding | No | ||
| sampler | No | ||
| strength | No | ||
| workflow | No | ||
| scheduler | No | ||
| negative_prompt | No |