A compact low-cost editing route for commercial refinements, background changes, recoloring, and rapid reference-based iteration.
Provider: Black Forest Labs
Category: image generation
Endpoint: /v1/tasks
Status: Available
Cost: See live page pricing
A compact low-cost editing route for commercial refinements, background changes, recoloring, and rapid reference-based iteration.
Pricing
Standard Usage
Controls saved image quality. PNG is usually unaffected; Range: 0 - 100, Integer only
Choose the output image file format
Ready for generation
Configure your parameters and click "Run" to see the output here.
Choose an adjacent model by task, output tier, and reference-image needs.
A general-purpose route with optional references and broad aspect-ratio coverage.
A compact low-cost editing route for commercial refinements, background changes, recoloring, and rapid reference-based iteration.
The Playground and API use the same model ID: flux-2-klein-4b/image-to-image. Reference images provide subject, product, scene, or style facts, while the prompt assigns each role and limits the edit.
Explore reference limits, sizes, formats and quality settings for FLUX.2 [klein] 4B Image to Image.
Final cost depends on the output tier and input add-ons. Check the live page price and task record for the final charge.
References provide visual facts; the prompt assigns their roles and limits the edit.
Copy a minimal request below. See Docs for parameters, callbacks, task retrieval, and errors.
POST /v1/tasksflux-2-klein-4b/image-to-imagecurl -X POST "https://api.hiapi.ai/v1/tasks" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "flux-2-klein-4b/image-to-image",
"input": {
"prompt": "Change the product color and preserve its structure",
"aspect_ratio": "match_input_image",
"image_urls": [
"https://example.com/reference.jpg"
],
"output_format": "png",
"output_quality": 95,
"resolution": "1 MP"
}
}'The create request immediately returns a taskId; image generation continues asynchronously.
A compact low-cost editing route for commercial refinements, background changes, recoloring, and rapid reference-based iteration.
Yes. This route requires reference input and accepts up to 1 image.
The page exposes 0.25 MP, 0.5 MP, 1 MP, 2 MP, 4 MP and 1:1, 16:9, 9:16, 4:3, 3:4; use the Playground contract for the final available set.
Billing is per successful generated image. Resolution or quality differences, when present, are reflected by the live page price.
POST an asynchronous task to /v1/tasks with model set to flux-2-klein-4b/image-to-image and put generation fields inside input.
Choose 1 to 1 publicly accessible images without redundant or conflicting roles.
Describe the requested edit and the subject, text, composition, lighting, and positions that must remain.
Check the reference relationship in Playground, then create asynchronous tasks with the same model ID.