## Basic tool info Model name: wiro/depth-to-image-sd Model description: Create variations of an image while preserving shape and depth. Model cover: https://cdn.wiro.ai/uploads/models/wiro-depth-to-image-cover.jpg Model categories: - tool - sd - depth-to-image Run Task Endpoint (POST): https://api.wiro.ai/v1/Run/wiro/depth-to-image-sd Get Task Detail Endpoint (POST): https://api.wiro.ai/v1/Task/Detail ## Model Inputs: - name: selectedModel label: select-model help: select-model-help type: select default: "56" options: - value: "56" label: stabilityai/stable-diffusion-2-depth description: This stable-diffusion-2-depth model is resumed from stable-diffusion-2-base and finetuned for 200k steps. triggerwords: [] generatesettings: [] modelfolderid: 124880 image: https://cdn.wiro.ai/uploads/models/stabilityai-stable-diffusion-2-depth-cover.jpg computingtime: 1 second readme: generate-art-with-stable-diffusion-readme categories: ["model","sd","depth-to-image","checkpoint-folder","fp32"] filename: docker arguments: run --gpus device=~>GPU:DEVICENO<~ -t ~>DOCKERMOUNT<~ --rm harbor_sd_docker:latest accelerate launch /wiro/sd/depth_to_image.py --model_path="~>FOLDER:124880<~" --image="~>{{params_inputImageType}}:{{params_inputImage}}<~" --output="~>FOLDEROUTPUT<~" --prompt="{{params_prompt}}" --negative_prompt="{{params_negativePrompt}}" --width={{params_width}} --height={{params_height}} --inference_steps={{params_steps}} --samples={{params_samples}} --guidance_scale={{params_scale}} --seed={{params_seed}} --strength={{params_strength}} --scheduler="{{params_scheduler}}" --cache_dir="~>FOLDER:123374<~" parameters: [{"title":"","subtitle":"","items":[{"advanced":false,"type":"fileinput","class":"is-12","required":false,"rows":"4","id":"inputImage","placeholder":"input-image","label":"input-image","defaultvalue":"https://cdn.wiro.ai/uploads/sampleinputs/input-depth-to-image-1.jpg","value":"https://cdn.wiro.ai/uploads/sampleinputs/input-depth-to-image-1.jpg","minvalue":"","maxvalue":"","incrementby":"","optionsLoad":"","options":[],"note":"input-image-help"},{"advanced":false,"type":"text","class":"is-12","required":false,"rows":"0","id":"inputImageUrl","placeholder":"input-image-url","label":"input-image-url","defaultvalue":"","value":"","minvalue":"","maxvalue":"","incrementby":"","optionsLoad":"","options":[],"note":"input-image-url-help"},{"advanced":false,"type":"textarea","class":"is-12","required":true,"rows":"4","id":"prompt","placeholder":"prompt","label":"prompt","defaultvalue":"two tigers","value":"two tigers","minvalue":"","maxvalue":"","incrementby":"","optionsLoad":"","options":[],"note":"prompt-help"},{"advanced":false,"type":"textarea","class":"is-12","required":false,"rows":"2","id":"negativePrompt","placeholder":"negativeprompt","label":"negativeprompt","defaultvalue":"bad, deformed, ugly, bad anatomy","value":"bad, deformed, ugly, bad anatomy","minvalue":"","maxvalue":"","incrementby":"","optionsLoad":"","options":[],"note":"negativeprompt-help"},{"advanced":true,"type":"number","class":"is-12","required":false,"rows":"0","id":"samples","placeholder":"numberofoutputs","label":"numberofoutputs","defaultvalue":"1","value":"1","minvalue":"1","maxvalue":"2","incrementby":"1","optionsLoad":"","options":[],"note":"numberofoutputs-help"},{"advanced":true,"type":"number","class":"is-12","required":false,"rows":"0","id":"steps","placeholder":"inferencesteps","label":"inferencesteps","defaultvalue":"30","value":"30","minvalue":"1","maxvalue":"500","incrementby":"1","optionsLoad":"","options":[],"note":"inferencesteps-help"},{"advanced":true,"type":"float","class":"is-12","required":false,"rows":"0","id":"scale","placeholder":"guidancescale","label":"guidancescale","defaultvalue":"7.5","value":"7.5","minvalue":"1","maxvalue":"20","incrementby":"0.1","optionsLoad":"","options":[],"note":"guidancescale-help"},{"advanced":true,"type":"float","class":"is-12","required":false,"rows":"0","id":"strength","placeholder":"strength","label":"strength","defaultvalue":"0.85","value":"0.85","minvalue":"0.00","maxvalue":"1.00","incrementby":"0.01","optionsLoad":"","options":[],"note":"strength-help"},{"advanced":true,"type":"text","class":"is-12","required":false,"rows":"0","id":"seed","placeholder":"seed","label":"seed","defaultvalue":"123456","value":"123456","minvalue":"0","maxvalue":"9999999","incrementby":"1","optionsLoad":"","options":[],"note":"seed-help"},{"advanced":true,"type":"select","class":"is-12","required":false,"rows":"0","id":"scheduler","placeholder":"scheduler","label":"scheduler","defaultvalue":"EulerDiscreteScheduler","value":"EulerDiscreteScheduler","minvalue":"","maxvalue":"","incrementby":"","optionsLoad":"","options":[{"value":"EulerDiscreteScheduler","text":"EulerDiscreteScheduler"},{"value":"DDIMScheduler","text":"DDIMScheduler"},{"value":"LMSDiscreteScheduler","text":"LMSDiscreteScheduler"},{"value":"DPMSolverMultistepScheduler","text":"DPMSolverMultistepScheduler"},{"value":"EulerDiscreteScheduler","text":"EulerDiscreteScheduler"},{"value":"PNDMScheduler","text":"PNDMScheduler"},{"value":"DDPMScheduler","text":"DDPMScheduler"},{"value":"EulerAncestralDiscreteScheduler","text":"EulerAncestralDiscreteScheduler"}],"note":"scheduler-help"},{"advanced":true,"type":"number","class":"is-4","required":false,"rows":"0","id":"width","placeholder":"width","label":"width","defaultvalue":"512","value":"512","minvalue":"0","maxvalue":"2048","incrementby":"1","optionsLoad":"","options":[],"note":"width-help"},{"advanced":true,"type":"number","class":"is-4","required":false,"rows":"0","id":"height","placeholder":"height","label":"height","defaultvalue":"512","value":"512","minvalue":"0","maxvalue":"2048","incrementby":"1","optionsLoad":"","options":[],"note":"height-help"}]}] inspire: [{"inputImage":"input-depth-to-image-2.jpg","prompt":"professional photo of a Batman jumping between two high rises, beautiful colorful city landscape in the background","negativePrompt":"bad, deformed, ugly, bad anatomy"},{"inputImage":"input-depth-to-image-1.jpg","prompt":"two tigers","negativePrompt":"bad, deformed, ugly, bad anatomy"},{"inputImage":"input-depth-to-image-3.jpg","prompt":"high definition photo of a baby astronaut space walking at the international space station with earth seeing from above in the background","negativePrompt":"bad, deformed, ugly, bad anatomy"},{"inputImage":"input-depth-to-image-4.jpg","prompt":"a photo of a bag of cookies in the bathroom","negativePrompt":"low light, dark, blurry"}] samples: ["https://cdn.wiro.ai/uploads/models/stabilityai-stable-diffusion-2-depth-sample-1.jpg","https://cdn.wiro.ai/uploads/models/stabilityai-stable-diffusion-2-depth-sample-2.jpg","https://cdn.wiro.ai/uploads/models/stabilityai-stable-diffusion-2-depth-sample-3.jpg","https://cdn.wiro.ai/uploads/models/stabilityai-stable-diffusion-2-depth-sample-4.jpg"] time: 1692705097 marketplace: 1 trainallowed: 1 cps: 0.000000000000 ownercpt: 0.000000000000 onlymembers: 0 tags: [] averagepoint: 0.00 commentcount: 0 ratedusercount: 0 priority: 0 teststatus: 0 testdate: 1716547042 sourceurl: https://huggingface.co/stabilityai/stable-diffusion-2-depth sourcedownloadurl: https://huggingface.co/stabilityai/stable-diffusion-2-depth license: [] licenseupdate: 1785738693 cleanslugowner: stabilityai cleanslugproject: stable-diffusion-2-depth noindex: 1 modifiedtime: 0 - name: selectedModelPrivate label: select-model-private help: select-model-private-help type: select default: "" options: - name: inputImageUrl label: input-image-url help: input-image-url-help type: text default: - name: prompt label: prompt help: prompt-help type: textarea default: two tigers - name: negativePrompt label: negativeprompt help: negativeprompt-help type: textarea default: bad, deformed, ugly, bad anatomy - name: samples label: numberofoutputs help: numberofoutputs-help type: number default: 1 - name: steps label: inferencesteps help: inferencesteps-help type: number default: 30 - name: scale label: guidancescale help: guidancescale-help type: float default: 7.5 - name: strength label: strength help: strength-help type: float default: 0.85 - name: seed label: seed help: seed-help type: text default: 123456 - name: scheduler label: scheduler help: scheduler-help type: select default: EulerDiscreteScheduler options: - value: "EulerDiscreteScheduler" label: EulerDiscreteScheduler - value: "DDIMScheduler" label: DDIMScheduler - value: "LMSDiscreteScheduler" label: LMSDiscreteScheduler - value: "DPMSolverMultistepScheduler" label: DPMSolverMultistepScheduler - value: "EulerDiscreteScheduler" label: EulerDiscreteScheduler - value: "PNDMScheduler" label: PNDMScheduler - value: "DDPMScheduler" label: DDPMScheduler - value: "EulerAncestralDiscreteScheduler" label: EulerAncestralDiscreteScheduler - name: width label: width help: width-help type: number default: 512 - name: height label: height help: height-help type: number default: 512 ## 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/wiro/depth-to-image-sd" -H "Content-Type: multipart/form-data" -H "x-api-key: ${YOUR_API_KEY}" -H "x-nonce: ${NONCE}" -H "x-signature: ${SIGNATURE}" -d '{ "selectedModel": "", "selectedModelPrivate": "", "inputImageUrl": "input-depth-to-image-1.jpg", "prompt": "two tigers", "negativePrompt": "bad, deformed, ugly, bad anatomy", "samples": 1, "steps": 30, "scale": "7.5", "strength": "0.85", "seed": "123456", "scheduler": "EulerDiscreteScheduler", "width": 512, "height": 512, "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.