v4
latestOpenAPI 3.0.22026-08-02109239415.7 KBGenerate Magic Prompt
Transforms basic prompts into a magic prompt. Internal use only (feature flagged). TODO: update description if enabled externally.
Request body
The prompt to enhance with a magic prompt. Mutually exclusive with messages; one of the two must be set.
The magic prompt version to use when magic prompt option is set to AUTO or ON.
Whether to classify the prompt into a use case category.
The style type to generate with.
Random seed for reproducible generation
Generations with character reference are subject to the character reference pricing. A set of images to use as character references (maximum total size 10MB across all character references), currently only supports 1 character reference image. The images should be in JPEG, PNG or WebP format.
A system prompt to use for the magic prompt.
The aspect ratio to use for image generation, which determines the image's resolution. Cannot be used in conjunction with resolution. Defaults to 1x1.
Sampling temperature override. Defaults to the trainer-conditioned value when omitted (0.7 for V4_QWEN_3_5_27B). Only honored with V4 magic-prompt versions; supplying it with another version returns 400.
Nucleus-sampling top_p override. Only honored with V4 versions.
Top-k sampling override. Only honored with V4 versions.
min_p sampling override. Only honored with V4 versions.
Cap on the number of tokens the model may generate. Defaults to 4096 (the trainer's reference cap) when omitted. Only honored with V4 versions.
Presence-penalty override. Only honored with V4 versions.
Frequency-penalty override. Only honored with V4 versions.
Repetition-penalty override. Only honored with V4 versions.
Optional override of the LoRA adapter the V4 magic-prompt wrapper downloads and runs. Pass a gs:// URI pointing at a checkpoint directory containing adapter_config.json. When omitted, the wrapper-preloaded production checkpoint is used. Honored with the wrapper-routed LoRA versions V4_QWEN_3_5_27B and V4_QWEN_3_5_27B_FULL_FINETUNE_LORA; supplying it with V4_QWEN_3_5_27B_PREFUSED or V4_QWEN_3_5_27B_FULL_FINETUNE (which serve fixed weights and cannot swap adapters per request) or any other version returns 400.
Example request
{
"prompt": "a cat",
"magic_prompt_version": "V_0_4",
"classify_prompt_category": true,
"style_type": "AUTO",
"seed": 12345
}Response
Magic prompt generated successfully.
The generated magic prompt
The magic prompt version to use when magic prompt option is set to AUTO or ON.
Identifier of the underlying model that produced this prompt. For experimental versions, whose backing model can change over time, this reports the model that actually served the request. Null when not applicable.
Example response
{
"magic_prompt": "A photorealistic cat with striking green eyes, sitting gracefully on a vintage wooden chair. The cat's fur has beautiful orange and white markings, and soft natural lighting illuminates the scene from a nearby window.",
"magic_prompt_version": "V4_QWEN_3_5_27B_EXPERIMENTAL_SLOT_01",
"served_model_name": "qwen35-27b-magic-prompt-experimental-2026-06-17"
}