## Basic tool info Model name: black-forest-labs/flux-2-flex Model description: Flux 2 Flex model Model cover: https://cdn.wiro.ai/uploads/models/black-forest-labs-flux-2-flex-cover.webp Model categories: - tool - bfl - partner - flux-2-flex - text-to-image - image-to-image - image-editing Model tags: - image generation Run Task Endpoint (POST): https://api.wiro.ai/v1/Run/black-forest-labs/flux-2-flex Get Task Detail Endpoint (POST): https://api.wiro.ai/v1/Task/Detail ## Model Inputs: - name: inputImage label: Input Image help: It accepts up to 10 images type: combinefileinput default: bfl-flux-2-flex-input-4-1.jpg,bfl-flux-2-flex-input-4-2.jpg,bfl-flux-2-flex-input-4-3.jpg - name: prompt label: Prompt help: Text prompt for image generation. type: textarea default: Add woman in the image 2 and dog in the image 3 under the umbrella in the image 1 facing to the sea. - name: width label: Width help: Width in pixels (must be multiple of 16). Set it to 0 or do not send if you want to match input image. Flux accepts between 64 and 2048. type: number default: 1024 - name: height label: Height help: Height in pixels (must be multiple of 16). Set it to 0 or do not send if you want to match input image. Flux accepts between 64 and 2048. type: number default: 1024 - name: safetyTolerance label: Safety Tolerance help: Tolerance level for input and output moderation. Between 0 and 6, 0 being most strict, 6 being least strict. type: number default: 2 - name: seed label: Seed help: Seed for reproducible results. Use the same seed to get consistent outputs. type: number default: 123 - name: guidance label: Guidance help: Guidance scale. Controls how closely the output follows the prompt. Minimum: 1.5, maximum: 10, default: 4.5. Higher = closer prompt adherence. type: float default: 4.5 - name: steps label: Steps help: Number of inference steps. Maximum: 50, default: 50. Higher = more detail, slower. type: number default: 50 - name: outputFormat label: Output Format help: Output format for the generated image. type: select default: png options: - value: "jpeg" label: JPEG - value: "png" label: PNG ## Model Parameter Inspires: - prompt: The interior of a minimalist, futuristic library on a Mars colony. Floor-to-ceiling panoramic windows show a dust-covered red landscape and a distant Earth. The room is softly lit by cool blue ambient lighting emanating from thin recessed strips in the polished white floor. A single holographic projection of a spinning astronomical map floats in the center. Wide-angle architectural photography, high-dynamic range (HDR), incredibly sharp details. - inputImage: - prompt: A meticulously plated seared scallop appetizer arranged on a handcrafted, speckled porcelain plate. The scallops are perfectly golden-brown, garnished with a sprinkle of chive slivers and a swirl of deep red reduction sauce. Dramatic, high-contrast sidelight emphasizes the texture and steam rising gently from the dish. Shot on a 100mm macro lens, shallow depth of field, ultra-realistic food styling. - inputImage: - prompt: A faithful, hyper-realistic reproduction of a chipped, aged fresco depicting a classical Roman god, painted directly onto a rough, cracked stucco wall. The paint is peeling in patches, revealing the underlying plaster. Natural daylight streams in from a high archway, illuminating the texture of the cracks and the faded pigments. Medium shot, archival quality, sense of great age and decay. - inputImage: - prompt: Add woman in the image 2 and dog in the image 3 under the umbrella in the image 1 facing to the sea. - inputImage: https://cdn.wiro.ai/uploads/sampleinputs/bfl-flux-2-flex-input-4-1.jpg,https://cdn.wiro.ai/uploads/sampleinputs/bfl-flux-2-flex-input-4-2.jpg,https://cdn.wiro.ai/uploads/sampleinputs/bfl-flux-2-flex-input-4-3.jpg - prompt: Integrate a moderately sized crowd of people congregating respectfully around the small chapel. The individuals should be dressed in casual winter attire (jackets, hats, scarves), facing towards the chapel or engaging in quiet conversation. Some figures should be positioned in the immediate foreground, walking towards the chapel, while others are closer to the structure. Ensure the crowd looks natural and diverse, maintaining a realistic photographic style consistent with the original image\'s lighting and atmosphere. The overall impression should be a peaceful gathering, perhaps for a small ceremony or a visit to the landmark, without overwhelming the chapel itself. - inputImage: https://cdn.wiro.ai/uploads/sampleinputs/bfl-flux-2-flex-input-5.jpg ## Integration Header Prepare ```bash # Sign up Wiro dashboard and create project export YOUR_API_KEY="{{useSelectedProjectAPIKey}}"; export YOUR_API_SECRET="XXXXXXXXX"; # unix time or any random integer value export NONCE=$(date +%s); # hmac-SHA256 (YOUR_API_SECRET+Nonce) with YOUR_API_KEY export SIGNATURE="$(echo -n "${YOUR_API_SECRET}${NONCE}" | openssl dgst -sha256 -hmac "${YOUR_API_KEY}")"; ``` ## Run Command - Make HTTP Post Request ```bash curl -X POST "https://api.wiro.ai/v1/Run/black-forest-labs/flux-2-flex" -H "Content-Type: multipart/form-data" -H "x-api-key: ${YOUR_API_KEY}" -H "x-nonce: ${NONCE}" -H "x-signature: ${SIGNATURE}" -d '{ "inputImage": [ "bfl-flux-2-flex-input-4-1.jpg", "bfl-flux-2-flex-input-4-2.jpg", "bfl-flux-2-flex-input-4-3.jpg" ], "prompt": "Add woman in the image 2 and dog in the image 3 under the umbrella in the image 1 facing to the sea.", "width": 1024, "height": 1024, "safetyTolerance": 2, "seed": 123, "guidance": "4.5", "steps": 50, "outputFormat": "png", "callbackUrl": "You can provide a callback URL; Wiro will send a POST request to it when the task is completed." }'; ``` ## Run Command - Response ```json { "errors": [], "taskid": "2221", "socketaccesstoken": "eDcCm5yyUfIvMFspTwww49OUfgXkQt", "result": true } ``` ## Get Task Detail - Make HTTP Post Request with Task ID ```bash curl -X POST "https://api.wiro.ai/v1/Task/Detail" -H "Content-Type: multipart/form-data" -H "x-api-key: ${YOUR_API_KEY}" -H "x-nonce: ${NONCE}" -H "x-signature: ${SIGNATURE}" -d '{ "taskid": "2221" }'; ``` ## Get Task Detail - Make HTTP Post Request with Socket Access Token ```bash curl -X POST "https://api.wiro.ai/v1/Task/Detail" -H "Content-Type: multipart/form-data" -H "x-api-key: ${YOUR_API_KEY}" -H "x-nonce: ${NONCE}" -H "x-signature: ${SIGNATURE}" -d '{ "tasktoken": "eDcCm5yyUfIvMFspTwww49OUfgXkQt" }'; ``` ## Get Task Detail - Response ```json { "total": "1", "errors": [], "tasklist": [ { "id": "2221", "uuid": "15bce51f-442f-4f44-a71d-13c6374a62bd", "socketaccesstoken": "eDcCm5yyUfIvMFspTwww49OUfgXkQt", "parameters": {}, "debugoutput": "", "debugerror": "", "starttime": "1734513809", "endtime": "1734513813", "elapsedseconds": "6.0000", "status": "task_postprocess_end", "createtime": "1734513807", "canceltime": "0", "assigntime": "1734513807", "accepttime": "1734513807", "preprocessstarttime": "1734513807", "preprocessendtime": "1734513807", "postprocessstarttime": "1734513813", "postprocessendtime": "1734513814", "outputs": [ { "id": "6bc392c93856dfce3a7d1b4261e15af3", "name": "0.png", "contenttype": "image/png", "parentid": "6c1833f39da71e6175bf292b18779baf", "uuid": "15bce51f-442f-4f44-a71d-13c6374a62bd", "size": "202472", "addedtime": "1734513812", "modifiedtime": "1734513812", "accesskey": "dFKlMApaSgMeHKsJyaDeKrefcHahUK", "url": "https://cdn1.wiro.ai/6a6af820-c5050aee-40bd7b83-a2e186c6-7f61f7da-3894e49c-fc0eeb66-9b500fe2/0.png" } ], "size": "202472" } ], "result": true } ``` ## Kill Task - Make HTTP Post Request with Task ID ```bash curl -X POST "https://api.wiro.ai/v1/Task/Kill" -H "Content-Type: multipart/form-data" -H "x-api-key: ${YOUR_API_KEY}" -H "x-nonce: ${NONCE}" -H "x-signature: ${SIGNATURE}" -d '{ "taskid": "534574" }'; ``` ## Kill Task - Make HTTP Post Request with Socket Access Token ```bash curl -X POST "https://api.wiro.ai/v1/Task/Kill" -H "Content-Type: multipart/form-data" -H "x-api-key: ${YOUR_API_KEY}" -H "x-nonce: ${NONCE}" -H "x-signature: ${SIGNATURE}" -d '{ "socketaccesstoken": "ZpYote30on42O4jjHXNiKmrWAZqbRE" }'; ``` ## Kill Task - Response ```json { "errors": [], "tasklist": [ { "id": "534574", "uuid": "15bce51f-442f-4f44-a71d-13c6374a62bd", "name": "", "socketaccesstoken": "ZpYote30on42O4jjHXNiKmrWAZqbRE", "parameters": { "inputImage": "https://api.wiro.ai/v1/File/mCmUXgZLG1FNjjjwmbtPFr2LVJA112/inputImage-6060136.png" }, "debugoutput": "", "debugerror": "", "starttime": "1734513809", "endtime": "1734513813", "elapsedseconds": "6.0000", "status": "task_cancel", "cps": "0.000585000000", "totalcost": "0.003510000000", "guestid": null, "projectid": "699", "modelid": "598", "description": "", "basemodelid": "0", "runtype": "model", "modelfolderid": "", "modelfileid": "", "callbackurl": "", "marketplaceid": null, "createtime": "1734513807", "canceltime": "0", "assigntime": "1734513807", "accepttime": "1734513807", "preprocessstarttime": "1734513807", "preprocessendtime": "1734513807", "postprocessstarttime": "1734513813", "postprocessendtime": "1734513814", "pexit": "0", "categories": "["tool","image-to-image","quick-showcase","compare-landscape"]", "outputs": [ { "id": "6bc392c93856dfce3a7d1b4261e15af3", "name": "0.png", "contenttype": "image/png", "parentid": "6c1833f39da71e6175bf292b18779baf", "uuid": "15bce51f-442f-4f44-a71d-13c6374a62bd", "size": "202472", "addedtime": "1734513812", "modifiedtime": "1734513812", "accesskey": "dFKlMApaSgMeHKsJyaDeKrefcHahUK", "foldercount": "0", "filecount": "0", "ispublic": 0, "expiretime": null, "url": "https://cdn1.wiro.ai/6a6af820-c5050aee-40bd7b83-a2e186c6-7f61f7da-3894e49c-fc0eeb66-9b500fe2/0.png" } ], "size": "202472" } ], "result": true } ``` ## Cancel Task - Make HTTP Post Request (For tasks on queue) ```bash curl -X POST "https://api.wiro.ai/v1/Task/Cancel" -H "Content-Type: multipart/form-data" -H "x-api-key: ${YOUR_API_KEY}" -H "x-nonce: ${NONCE}" -H "x-signature: ${SIGNATURE}" -d '{ "taskid": "634574" }'; ``` ## Cancel Task - Response ```json { "errors": [], "tasklist": [ { "id": "634574", "uuid": "15bce51f-442f-4f44-a71d-13c6374a62bd", "name": "", "socketaccesstoken": "ZpYote30on42O4jjHXNiKmrWAZqbRE", "parameters": { "inputImage": "https://api.wiro.ai/v1/File/mCmUXgZLG1FNjjjwmbtPFr2LVJA112/inputImage-6060136.png" }, "debugoutput": "", "debugerror": "", "starttime": "1734513809", "endtime": "1734513813", "elapsedseconds": "6.0000", "status": "task_cancel", "cps": "0.000585000000", "totalcost": "0.003510000000", "guestid": null, "projectid": "699", "modelid": "598", "description": "", "basemodelid": "0", "runtype": "model", "modelfolderid": "", "modelfileid": "", "callbackurl": "", "marketplaceid": null, "createtime": "1734513807", "canceltime": "0", "assigntime": "1734513807", "accepttime": "1734513807", "preprocessstarttime": "1734513807", "preprocessendtime": "1734513807", "postprocessstarttime": "1734513813", "postprocessendtime": "1734513814", "pexit": "0", "categories": "["tool","image-to-image","quick-showcase","compare-landscape"]", "outputs": [ { "id": "6bc392c93856dfce3a7d1b4261e15af3", "name": "0.png", "contenttype": "image/png", "parentid": "6c1833f39da71e6175bf292b18779baf", "uuid": "15bce51f-442f-4f44-a71d-13c6374a62bd", "size": "202472", "addedtime": "1734513812", "modifiedtime": "1734513812", "accesskey": "dFKlMApaSgMeHKsJyaDeKrefcHahUK", "foldercount": "0", "filecount": "0", "ispublic": 0, "expiretime": null, "url": "https://cdn1.wiro.ai/6a6af820-c5050aee-40bd7b83-a2e186c6-7f61f7da-3894e49c-fc0eeb66-9b500fe2/0.png" } ], "size": "202472" } ], "result": true } ``` ## Task Status Information This section defines the possible task status values returned by the API when polling for task completion. ### Completed Task Statuses (Polling can stop) These indicate that the task has reached a terminal state — either success or failure. Once any of these is received, polling should stop. - task_postprocess_end : Task completed successfully and post-processing is done. - task_cancel : Task was cancelled by the user or system. ### Running Task Statuses (Continue polling) These statuses indicate that the task is still in progress. Polling should continue if one of these is returned. - task_queue : Task is waiting in the queue. - task_accept : Task has been accepted for processing. - task_assign : Task is being assigned to a worker. - task_preprocess_start : Preprocessing is starting. - task_preprocess_end : Preprocessing is complete. - task_start : Task execution has started. - task_output : Output is being generated.