Run generations
run_generationsGenerate images: shot panels, story element reference sheets and production references, the art direction's Art Style Image, or any image generator of a group. Each target runs its generator once, as the Generate button does in the app, on the model and settings the generator has, and its prompt and references as they are now (set them first with set_prompt and add_reference_images).
Call it first without maxCredits: it returns the total for the whole batch (estimatedCredits), each target's cost and what is wired to run, and runs nothing. Targets that cannot run (unresolved references, an empty prompt, a video generator, a generator already running) come back under skipped with the reason. Ask the user once for the batch total, then call again with the same targets and maxCredits set to the approved amount. It returns a jobId per target at once; the images take about 10 to 60 seconds. Follow them with get_jobs.
Credits are charged to the project's organisation per image, as in the app; a failed run is refunded. Never generate on your own initiative after creating or importing a project: offer it and let the user decide. Video generation is not available to agents.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| targets | Yes | The generators to run, 40 at most per call. Each runs once on the model and settings it already has. Build the list from list_entities and list_shots (or get_group), e.g. every character's reference sheet: one { target: { kind: "story_element", id: entityId } } per character. | |
| projectId | Yes | ScreenWeaver project id (from list_projects). | |
| maxCredits | No | Leave out to get the cost estimate; nothing runs and nothing is charged. Ask the user to approve the total, then call again with maxCredits set to the amount they approved. The call is refused if the estimate is higher. |