makepad/libs/flow/recipes/templates/prompt-to-image.splash
Arena Agent d8d5ea8b6a Repair integration manifests and port nigig exports onto upstream widget families
Restore missing required asset/flow packages from the pinned nigig revision; retain upstream script isolation, X11 hover, and widget-core fixes. Validated makepad-widgets data feature with Rust 1.97.1.
2026-10-26 11:23:26 +00:00

42 lines
1.2 KiB
Text

use mod.flow.*
/** What to paint. */
let prompt = Input{ type: @text default: "a lighthouse at dusk" at: vec2(40, 120) }
let expand = Llm{
system: "Rewrite the prompt as one vivid paragraph for an image model.
Keep the subject. Add light, lens, material, mood. No lists."
prompt: prompt.text()
at: vec2(360, 120)
}
/** Appends the chosen style to the expanded prompt. */
let add_style = Fn{
in: { text: expand.text() style: "photo" }
out: [@text]
run: |i| { {text: i.text + ", " + i.style + " style"} }
at: vec2(680, 120)
ui: FnFace{
/* the style picker lives on the node whose input it sets */
style := ComboBox{
width: Fill height: 26
labels: ["photo", "anime", "oil paint"]
bind := "add_style.style"
}
}
}
let image = Image{
prompt: add_style.text()
width: 1024 height: 1024 steps: 8
at: vec2(1000, 120)
}
/** The finished picture. */
let picture = Output{ type: @image value: image.image() }
Flow{
label: "Prompt to image"
brief: "Expands a short prompt into a rich one and paints it."
prompt, expand, add_style, image, picture
}