Save a preset that puts a text model in front of the image generation helper, so every vague request becomes a detailed picture prompt.
Goal: a preset that wraps a text model around the image generation helper. The text model rewrites a vague request into a detailed picture prompt, then calls the helper. One call, a better picture.
Outcome: a preset any app calls like a model — @preset/image-enhancer. A user sends "a couscous poster for Yennayer"; the text model writes the scene — subject, composition, light, colours, style — before the picture model draws it.
Each request through this preset runs two models: the text model, on its tokens, and the picture model, on its own meter. Both are billed in DA, and the request's
usage.costcarries the whole charge.
@preset/image-enhancer.opendunes:image_generation with that prompt.Send the body you would send to /v1/chat/completions, to the preset route. The system prompt, the tools and the parameters are kept; the rest of the conversation is not.
curl https://opendunes.com/v1/presets/image-enhancer/chat/completions \
-H "Authorization: Bearer $OPENDUNES_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "anthropic/claude-sonnet-5",
"messages": [
{
"role": "system",
"content": "You are an expert visual prompt writer. When the user asks for a picture, expand the request into a detailed prompt — subject and action, composition, lighting, colour palette, style — then call the image generation tool with it. Reply with the picture and one sentence on what you made."
}
],
"tools": [
{
"type": "opendunes:image_generation",
"parameters": { "model": "openai/gpt-5-image-mini", "aspect_ratio": "3:4" }
}
],
"temperature": 0.7
}'Saving again under image-enhancer adds a new version and makes it current; every version is kept.
curl https://opendunes.com/v1/chat/completions \
-H "Authorization: Bearer $OPENDUNES_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "@preset/image-enhancer",
"messages": [{ "role": "user", "content": "A couscous poster for Yennayer" }]
}'Anything the request sets itself wins over the preset — a different temperature, or a tools array of its own.