Skip to main content

Image-to-image

What this lets you do

Transform one reference image through a durable managed turn.

What you need

  • A supported PNG, JPEG, or WebP file named reference.png
  • A server-side DreamLayer test or live key
  • One available live credit when using a live key
  • curl and jq

Steps

1. Upload one input

The service accepts supported PNG, JPEG, or WebP input within the published byte, dimension, and pixel limits. It decodes, strips metadata, and stores a normalized owner-scoped PNG.

2. Save the returned input_asset_id

The commands above store the opaque input_asset_id in INPUT_ASSET_ID. Store it as application state and do not infer storage paths from it.

3. Execute

V1 accepts one reference image. Unsupported, expired, or cross-account asset IDs fail closed. One completed image-to-image operation uses one live credit.

Confirm it worked

The stream emits one normalized PNG asset and ends with done status completed.

Common errors

  • 413: resize or recompress an input outside the published limits.
  • 404: upload a current asset owned by the authenticated account.
  • 422: send exactly one supported reference image in V1.

Troubleshooting

Upload the input again if it expired. Do not reuse an asset ID from another account or ask the API to reveal its internal storage path.

Next steps