Skip to content

Edit tools

Edit tools are models whose task works on existing media. They use the same call as any generation, POST /v1/generations, with the media to change in source (and sometimes references). source takes an asset ID, a generation ID, a public HTTPS URL or a small data URI, so the output of one generation can go straight into the next.

Each model’s page lists its exact parameters, limits and an example.

Continues a video with new footage. duration is the length added.

extend.sh
# Extends a video by 5 seconds. SOURCE is an asset ID, a generation ID or a public HTTPS URL. Spends at most 400 tokens.
set -euo pipefail
API="${HL_API_BASE:-https://api.halationlab.ai/v1}"
SOURCE="${HL_VIDEO:-https://docs.halationlab.ai/media/sample-video.mp4}"
curl -sS --fail-with-body "$API/generations" \
-H "Authorization: Bearer $HALATIONLAB_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Prefer: wait=60" \
-H "Content-Type: application/json" \
-d @- <<JSON
{
"model": "seedance-2.5-extend",
"input": { "source": "$SOURCE", "prompt": "The ball keeps rolling and slows to a stop", "duration": 5 },
"max_cost": 400
}
JSON

Changes a video by instruction, keeping what the prompt does not mention.

Changes the frame shape of a video, for example from 16:9 to 9:16, generating the new area.

Raises the resolution of a video.

Changes or combines images by instruction. Some image edit models take references as well as source.

Region edit models change only part of source. They require region: the area to change, in source pixels from the top-left corner, as a rectangle or a polygon of 3 to 500 points.

{ "type": "rectangle", "x": 470, "y": 190, "width": 340, "height": 340 }
{ "type": "polygon", "points": [[470, 190], [810, 190], [640, 530]] }
region-edit.sh
# Changes only a rectangle of an image. `region` is in source pixels from the top-left corner. Spends at most 100 tokens.
set -euo pipefail
API="${HL_API_BASE:-https://api.halationlab.ai/v1}"
SOURCE="${HL_SAMPLE_IMAGE_URL:-https://docs.halationlab.ai/media/sample-image.png}"
curl -sS --fail-with-body "$API/generations" \
-H "Authorization: Bearer $HALATIONLAB_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Prefer: wait=60" \
-H "Content-Type: application/json" \
-d @- <<JSON
{
"model": "gpt-image-2.5-sunburst-region-edit",
"input": {
"source": "$SOURCE",
"prompt": "Turn the ball into a glossy green apple",
"region": { "type": "rectangle", "x": 470, "y": 190, "width": 340, "height": 340 },
"quality": "low"
},
"max_cost": 100
}
JSON

Models that take region:

Extends an image beyond its borders to a new frame shape.

Raises the resolution of an image.

For a plain crop, trim or resize, which needs no model, use POST /v1/assets/{id}/transform. The copy is a new asset. See Uploading media.