Restructure a segment
segment_restructureChange what a segment is. Every call previews first: when no rendered image or clip would be lost it runs; otherwise it changes nothing and returns what would be lost. Show the user, then call again with confirm=true.
combine: merge with a neighboring segment. The kept segment's renders stay, retimed to the combined length, but go stale: its prompts are rewritten for the combined narration, so render it again after. The other's are deleted (the preview names it).
change_type: to an image, real photo, B-roll (both fetched) or overlay segment. Clips and talking heads come from render action=animate. keep_image turns a clip back into its image, keeping the render. A change between an image, real photo and B-roll keeps the prompts; render the image again.
rewrite: an AI rewrite of the prompts from feedback; render the image and clip again after. For exact text, use segment_edit set_prompts.
combine, rewrite and a change to or from an overlay segment write prompts in the background, and a change to a real photo or B-roll with no searches yet writes its searches (its prompts stay): a small AI step that spends credits (get_status wait=true). Until it finishes, change_type is refused (409). Sound effects and overlays always survive; change an overlay's text with editor_edit scene_note. Later segments may renumber: read the storyboard again.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to | No | change_type: the new kind | |
| keep | No | combine: whose prompts and renders survive | this |
| action | Yes | combine: with_segment_number, optional keep; change_type: to, optional keep_image; rewrite: feedback | |
| confirm | No | Run even though renders are lost; only after the user saw which | |
| feedback | No | rewrite: what to change, e.g. "make this a close-up" | |
| keep_image | No | change_type from a clip to image: keep the rendered image | |
| project_id | Yes | Project id | |
| segment_number | Yes | Segment number (1-based, from storyboard_read) | |
| with_segment_number | No | combine: the neighboring segment |