Generate Image (Popcraft)
popcraft_generate_imageSTOP FIRST if the ask is a YouTube/Instagram THUMBNAIL, a video COVER or packaging art, a UGC or product AD, or any other multi-step branded production: call popcraft_get_workflow_instructions and follow the matching workflow instead of calling this tool directly — it owns the concept frameworks, prompt structure, identity locks and QA that a one-shot prompt misses. Everything else (a plain image, an illustration, a single reference-driven render) belongs here — call it directly, no workflow needed — EXCEPT when the target model advertises prompt_guide_workflow in popcraft_models_explore (GPT Image 2.5 / gpt-image-2-5 and gpt-image-2-5-fast → "gpt-image-25-prompting"): for any directed job on such a model (an EDIT that must preserve a face/product/layout, reference images, exact in-frame text, a transparent cutout, or an "expand/optimize my prompt" ask) load that workflow first. Generate images with Popcraft — GPT Image 2, Seedream, Nano Banana, Midjourney and more. Defaults: aspect_ratio "1:1", resolution model-default, count 1 (must be 1, 2, or 4 — the Popcraft pricing tiers). Pass medias (GCS urls from popcraft_media_import_url or a prior popcraft_generate_image/popcraft_job_display result) with role:"reference" to condition on a reference image (style/composition/subject transfer) — omit medias for pure text-to-image. Pick model via popcraft_models_explore first if unsure — references are validated against the model before charging (count, media type, size, format), so check its reference_limits/image_input to avoid a rejected call. Set get_cost:true to preview the exact credit cost WITHOUT submitting a job — always do this before a first-time or expensive generation so the user can confirm. Local files attached in chat cannot be read by this remote server — use popcraft_media_upload_widget (or popcraft_media_upload) instead of asking for attachments. If a result carries recovery_tool, call that tool immediately; do not explain or ask first. On success, an interactive result card is shown to the user and refreshes itself automatically until the job finishes — do NOT poll or re-check status in a loop. Call popcraft_job_display at most once, and only if this client did not render a result card or the user asks about the job again later. The result includes project — the Popcraft project the output was filed into; when the user did not pass project_id/project_name, mention it briefly (e.g. "saved to ") so they know where it landed. Never tell the user how long the job will take or quote any estimate of generation time — the result card shows progress.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| count | No | Number of images: 1, 2, or 4 (Popcraft pricing tiers) — default 1 | |
| model | Yes | Popcraft model id, e.g. "gpt-image-2", "seedream-4-0", "nano-banana" — list via popcraft_models_explore | |
| medias | No | Reference images as GCS URLs from popcraft_media_import_url or prior results; role:"reference" conditions the generation on the image (style/composition/subject transfer) | |
| prompt | No | Text prompt describing the image to generate | |
| get_cost | No | true = return the exact credit cost WITHOUT submitting; use this before a first-time or expensive generation | |
| project_id | No | File the result into this Popcraft project (id from popcraft_projects). Omit to use the user's current/last-used project (or a default). Errors if you don't own it. | |
| resolution | No | Model-specific resolution/size string, e.g. "1K", "2K" — omit for the model default | |
| aspect_ratio | No | e.g. "1:1", "16:9", "9:16", "4:3" — default "1:1" | |
| project_name | No | File the result into the project with this title, creating it if it doesn't exist. Ignored when project_id is set. |