Modify an image based on a user-provided image and prompt.Documentation Index
Fetch the complete documentation index at: https://platform.stepfun.ai/docs/llms.txt
Use this file to discover all available pages before exploring further.
Endpoint
POST https://api.stepfun.ai/v1/images/edits
Request parameters
-
modelstringrequired
The model name to use. Currently supported:step-image-edit-2
-
imagefilerequired
The input image file. Currently only one image is supported.step-image-edit-2: maximum input resolution 4096x4096; supports base64-encoded image input.
-
promptstringrequired
Text description for the edit. Maximum length: 512 characters. -
seedintoptional
Random seed.step-image-edit-2: range[0, 2147483647]. If not provided, the server randomly generates a seed.
-
stepsintoptional
Number of generation steps.step-image-edit-2: range[1, 50]. Default 8.
-
cfg_scalefloatoptional
Classifier-free guidance scale.step-image-edit-2: must be >= 1.0, range[1.0, 10.0]. Default 1.0.
-
sizestringoptional
step-image-edit-2: this parameter is ignored for editing; the result image is returned at the same size as the input image.
-
negative_promptstringoptional
Negative prompt. Up to 512 characters, default"". Whencfg_scale = 1.0, the current implementation does not pass the negative prompt to the underlying model. -
text_modebooloptional
Optimization strategy for text-rendering scenarios. DefaultFalse, enable as needed. -
response_formatstringoptional
Format of the returned image. Supported:b64_jsonorurl. Defaulturl.
Response
createdint
Timestamp of when the image was created (seconds).dataobject array
Array of generated image objects.seedint
The seed used during generation.finish_reasonstring
Reason for completion.successindicates successful generation;content_filteredindicates successful generation but stopped due to content filtering.b64_jsonstring
Base64-encoded image. Returned whenresponse_formatisb64_json.urlstring
Image download URL. Returned whenresponse_formatisurl. The URL has a limited validity period (currently 2 hours); download and save the image to your own storage to avoid relying on this link.
Example
- curl