makepad/libs/flow/tests/fixtures/prompt_image.splash
Admin 2b98a1f048 flow: the run engine — instances with an inputs table, one VM per run with live Fn closures, a dataflow scheduler, five executors (chat over the hub session, gen over the fleet, fn, http under an egress policy, ask that parks a run), content-addressed values with a RAM budget and spill
Real adapters by default (HubChat, FleetGen, HubHttp); seams for tests; the
gen path is proven end to end against the in-process testpattern hub service.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-03 17:01:53 +02:00

37 lines
1 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)
}
let styled = Fn{
in: { text: expand.text() style: "photo" }
out: [@text]
run: |i| { {text: i.text + ", " + i.style + " style"} }
at: vec2(680, 120)
}
let image = Image{
prompt: styled.text()
width: 1024 height: 1024 steps: 8
at: vec2(1000, 120)
ui: ImageFace{
/* the AI added a style picker; its value feeds the Fn above */
style := DropDown{ labels: ["photo", "anime", "oil paint"] bind: styled.style }
}
}
/** 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, styled, image, picture
}