Skip to Content
API CallImage Generationstepfun-ai/step1x-edit

stepfun-ai/step1x-edit API

This document introduces the input and output parameters of the stepfun-ai/step1x-edit model API, for referencing field meanings during interface use.


Request Parameters

Request Body

Field NameTypeRequiredDefault ValueDescription
promptstringYes-Prompt word
modelstringYes-The model name used for this request, which here is stepfun-ai/step1x-edit.
imagestringYes-Base64 data or image link http://xxx
nintOptional1The number of images generated, ranging from 1 to 4
strengthfloatOptional0.8The degree of transformation referenced by the image, ranging from 0 to 1
seedintOptional-1Random seed, used to control the randomness of the model’s generated content. For consistent content, use the same seed value.
stepsintOptional20Number of inference steps, ranging from 1 to 50
guidance_scalefloatOptional2.5The consistency between the model output and the prompt, i.e., the degree of freedom of the generated image; the larger the value, the lower the degree of freedom, and the stronger the correlation with the user’s prompt.
Range [1, 10].
negative_promptstringOptional-Negative prompt word, used to specify content you do not wish to appear in the generated image
response_formatstringOptional”url”Specify the format for returning the generated image, default is url, options include b64_json

Response Parameters

Field NameTypeDescription
createdintegerUnix timestamp (in seconds) of when the request was created.
dataarrayInformation about the output image, including the URL for downloading the image or Base64.
• If the format is specified as url, subfield is url;
• If the format is specified as b64_json, subfield is b64_json.
Note: The link will expire 7 days after generation, so be sure to save the image promptly.
errorObjectError information object
error.codestringError code
error.messagestringError message
error.paramstringRequest id

Example

OPENAI Compatible Interface

POST https://api.umodelverse.ai/v1/images/generations

Synchronous Request

curl --location 'https://api.umodelverse.ai/v1/images/generations' \ --header "Authorization: Bearer $MODELVERSE_API_KEY" \ --header 'Content-Type: application/json' \ --data '{ "model": "stepfun-ai/step1x-edit", "prompt": "Convert to quick pencil sketch", "image": "data:image/png;base64,{image_base64_string}", "negative_prompt": "blurry, low quality" }'
import os from openai import OpenAI client = OpenAI( base_url=os.getenv("BASE_URL", "https://api.umodelverse.ai/v1"), api_key=os.getenv("API_KEY", "$MODELVERSE_API_KEY") ) response = client.images.generate( model="stepfun-ai/step1x-edit", prompt="Convert to quick pencil sketch", extra_body={ "image": "data:image/png;base64,{image_base64_string}", "negative_prompt": "blurry, low quality" } ) print(response.data[0].url)

Response

{ "created": 1750667997, "data": [ { "url": "https://xxxxx/xxxx.png", "b64_json": "data:image/png;base64,{image_base64_string}" } ], "usage": { "input_tokens_details": {} } }
{ "error": { "message": "error_message", "type": "error_type", "param": "request_id", "code": "error_code" } }