cjwbw / stable-diffusion-img2img-v2.1
- Public
- 13.5K runs
-
A100 (80GB)
Prediction
cjwbw/stable-diffusion-img2img-v2.1:650c347f19a96c8a0379db998c4cd092e0734534591b16a60df9942d11dec15bIDyrdszp6qu5ctnfn3db4dga2zn4StatusSucceededSourceWebHardware–Total durationCreatedInput
- width
- 512
- height
- 512
- prompt
- A fantasy landscape, trending on artstation
- scheduler
- DPMSolverMultistep
- num_outputs
- 1
- guidance_scale
- 7.5
- prompt_strength
- 0.8
- num_inference_steps
- 25
{ "image": "https://replicate.delivery/pbxt/Hxv7VvAYYZZQw3JwZLC5HWu1IUDuocT35nrh1gWDJEwg2bjq/sketch-mountains-input.jpeg", "width": 512, "height": 512, "prompt": "A fantasy landscape, trending on artstation", "scheduler": "DPMSolverMultistep", "num_outputs": 1, "guidance_scale": 7.5, "prompt_strength": 0.8, "num_inference_steps": 25 }
Install Replicate’s Node.js client library:npm install replicate
Import and set up the client:import Replicate from "replicate"; const replicate = new Replicate({ auth: process.env.REPLICATE_API_TOKEN, });
Run cjwbw/stable-diffusion-img2img-v2.1 using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run( "cjwbw/stable-diffusion-img2img-v2.1:650c347f19a96c8a0379db998c4cd092e0734534591b16a60df9942d11dec15b", { input: { image: "https://replicate.delivery/pbxt/Hxv7VvAYYZZQw3JwZLC5HWu1IUDuocT35nrh1gWDJEwg2bjq/sketch-mountains-input.jpeg", width: 512, height: 512, prompt: "A fantasy landscape, trending on artstation", scheduler: "DPMSolverMultistep", num_outputs: 1, guidance_scale: 7.5, prompt_strength: 0.8, num_inference_steps: 25 } } ); // To access the file URL: console.log(output[0].url()); //=> "http://example.com" // To write the file to disk: fs.writeFile("my-image.png", output[0]);
To learn more, take a look at the guide on getting started with Node.js.
Install Replicate’s Python client library:pip install replicate
Import the client:import replicate
Run cjwbw/stable-diffusion-img2img-v2.1 using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run( "cjwbw/stable-diffusion-img2img-v2.1:650c347f19a96c8a0379db998c4cd092e0734534591b16a60df9942d11dec15b", input={ "image": "https://replicate.delivery/pbxt/Hxv7VvAYYZZQw3JwZLC5HWu1IUDuocT35nrh1gWDJEwg2bjq/sketch-mountains-input.jpeg", "width": 512, "height": 512, "prompt": "A fantasy landscape, trending on artstation", "scheduler": "DPMSolverMultistep", "num_outputs": 1, "guidance_scale": 7.5, "prompt_strength": 0.8, "num_inference_steps": 25 } ) print(output)
To learn more, take a look at the guide on getting started with Python.
Run cjwbw/stable-diffusion-img2img-v2.1 using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
curl -s -X POST \ -H "Authorization: Bearer $REPLICATE_API_TOKEN" \ -H "Content-Type: application/json" \ -H "Prefer: wait" \ -d $'{ "version": "cjwbw/stable-diffusion-img2img-v2.1:650c347f19a96c8a0379db998c4cd092e0734534591b16a60df9942d11dec15b", "input": { "image": "https://replicate.delivery/pbxt/Hxv7VvAYYZZQw3JwZLC5HWu1IUDuocT35nrh1gWDJEwg2bjq/sketch-mountains-input.jpeg", "width": 512, "height": 512, "prompt": "A fantasy landscape, trending on artstation", "scheduler": "DPMSolverMultistep", "num_outputs": 1, "guidance_scale": 7.5, "prompt_strength": 0.8, "num_inference_steps": 25 } }' \ https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
Output
{ "completed_at": "2022-12-15T21:33:51.658704Z", "created_at": "2022-12-15T21:30:44.467863Z", "data_removed": false, "error": null, "id": "yrdszp6qu5ctnfn3db4dga2zn4", "input": { "image": "https://replicate.delivery/pbxt/Hxv7VvAYYZZQw3JwZLC5HWu1IUDuocT35nrh1gWDJEwg2bjq/sketch-mountains-input.jpeg", "width": 512, "height": 512, "prompt": "A fantasy landscape, trending on artstation", "scheduler": "DPMSolverMultistep", "num_outputs": 1, "guidance_scale": 7.5, "prompt_strength": 0.8, "num_inference_steps": 25 }, "logs": "Using seed: 11808\n 0%| | 0/20 [00:00<?, ?it/s]\n 5%|▌ | 1/20 [00:00<00:04, 4.03it/s]\n 10%|█ | 2/20 [00:00<00:04, 4.36it/s]\n 15%|█▌ | 3/20 [00:00<00:03, 4.48it/s]\n 20%|██ | 4/20 [00:00<00:03, 4.54it/s]\n 25%|██▌ | 5/20 [00:01<00:03, 4.57it/s]\n 30%|███ | 6/20 [00:01<00:03, 4.59it/s]\n 35%|███▌ | 7/20 [00:01<00:02, 4.60it/s]\n 40%|████ | 8/20 [00:01<00:02, 4.61it/s]\n 45%|████▌ | 9/20 [00:01<00:02, 4.62it/s]\n 50%|█████ | 10/20 [00:02<00:02, 4.62it/s]\n 55%|█████▌ | 11/20 [00:02<00:01, 4.62it/s]\n 60%|██████ | 12/20 [00:02<00:01, 4.63it/s]\n 65%|██████▌ | 13/20 [00:02<00:01, 4.63it/s]\n 70%|███████ | 14/20 [00:03<00:01, 4.63it/s]\n 75%|███████▌ | 15/20 [00:03<00:01, 4.63it/s]\n 80%|████████ | 16/20 [00:03<00:00, 4.63it/s]\n 85%|████████▌ | 17/20 [00:03<00:00, 4.63it/s]\n 90%|█████████ | 18/20 [00:03<00:00, 4.63it/s]\n 95%|█████████▌| 19/20 [00:04<00:00, 4.63it/s]\n100%|██████████| 20/20 [00:04<00:00, 4.64it/s]\n100%|██████████| 20/20 [00:04<00:00, 4.60it/s]", "metrics": { "predict_time": 9.513888, "total_time": 187.190841 }, "output": [ "https://replicate.delivery/pbxt/Gum5FegZm90f20g6HCmQCXSU8o3sfIIsWNhjweIu4We0XiSBC/out-0.png" ], "started_at": "2022-12-15T21:33:42.144816Z", "status": "succeeded", "urls": { "get": "https://api.replicate.com/v1/predictions/yrdszp6qu5ctnfn3db4dga2zn4", "cancel": "https://api.replicate.com/v1/predictions/yrdszp6qu5ctnfn3db4dga2zn4/cancel" }, "version": "650c347f19a96c8a0379db998c4cd092e0734534591b16a60df9942d11dec15b" }
Generated inUsing seed: 11808 0%| | 0/20 [00:00<?, ?it/s] 5%|▌ | 1/20 [00:00<00:04, 4.03it/s] 10%|█ | 2/20 [00:00<00:04, 4.36it/s] 15%|█▌ | 3/20 [00:00<00:03, 4.48it/s] 20%|██ | 4/20 [00:00<00:03, 4.54it/s] 25%|██▌ | 5/20 [00:01<00:03, 4.57it/s] 30%|███ | 6/20 [00:01<00:03, 4.59it/s] 35%|███▌ | 7/20 [00:01<00:02, 4.60it/s] 40%|████ | 8/20 [00:01<00:02, 4.61it/s] 45%|████▌ | 9/20 [00:01<00:02, 4.62it/s] 50%|█████ | 10/20 [00:02<00:02, 4.62it/s] 55%|█████▌ | 11/20 [00:02<00:01, 4.62it/s] 60%|██████ | 12/20 [00:02<00:01, 4.63it/s] 65%|██████▌ | 13/20 [00:02<00:01, 4.63it/s] 70%|███████ | 14/20 [00:03<00:01, 4.63it/s] 75%|███████▌ | 15/20 [00:03<00:01, 4.63it/s] 80%|████████ | 16/20 [00:03<00:00, 4.63it/s] 85%|████████▌ | 17/20 [00:03<00:00, 4.63it/s] 90%|█████████ | 18/20 [00:03<00:00, 4.63it/s] 95%|█████████▌| 19/20 [00:04<00:00, 4.63it/s] 100%|██████████| 20/20 [00:04<00:00, 4.64it/s] 100%|██████████| 20/20 [00:04<00:00, 4.60it/s]
Prediction
cjwbw/stable-diffusion-img2img-v2.1:650c347f19a96c8a0379db998c4cd092e0734534591b16a60df9942d11dec15bIDb7bhjzdcc5fa3owrkskms4cpwaStatusSucceededSourceWebHardware–Total durationCreatedInput
- width
- 512
- height
- 512
- prompt
- A fantasy landscape, trending on artstation
- scheduler
- K_EULER_ANCESTRAL
- num_outputs
- 1
- guidance_scale
- 7.5
- prompt_strength
- 0.8
- num_inference_steps
- 25
{ "image": "https://replicate.delivery/pbxt/HxvEFarJTY5yHqvu7p0jfPeFVsEwPgc3va2s1rPCBR8aDGxm/sketch-mountains-input.jpeg", "width": 512, "height": 512, "prompt": "A fantasy landscape, trending on artstation", "scheduler": "K_EULER_ANCESTRAL", "num_outputs": 1, "guidance_scale": 7.5, "prompt_strength": 0.8, "num_inference_steps": 25 }
Install Replicate’s Node.js client library:npm install replicate
Import and set up the client:import Replicate from "replicate"; const replicate = new Replicate({ auth: process.env.REPLICATE_API_TOKEN, });
Run cjwbw/stable-diffusion-img2img-v2.1 using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run( "cjwbw/stable-diffusion-img2img-v2.1:650c347f19a96c8a0379db998c4cd092e0734534591b16a60df9942d11dec15b", { input: { image: "https://replicate.delivery/pbxt/HxvEFarJTY5yHqvu7p0jfPeFVsEwPgc3va2s1rPCBR8aDGxm/sketch-mountains-input.jpeg", width: 512, height: 512, prompt: "A fantasy landscape, trending on artstation", scheduler: "K_EULER_ANCESTRAL", num_outputs: 1, guidance_scale: 7.5, prompt_strength: 0.8, num_inference_steps: 25 } } ); // To access the file URL: console.log(output[0].url()); //=> "http://example.com" // To write the file to disk: fs.writeFile("my-image.png", output[0]);
To learn more, take a look at the guide on getting started with Node.js.
Install Replicate’s Python client library:pip install replicate
Import the client:import replicate
Run cjwbw/stable-diffusion-img2img-v2.1 using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run( "cjwbw/stable-diffusion-img2img-v2.1:650c347f19a96c8a0379db998c4cd092e0734534591b16a60df9942d11dec15b", input={ "image": "https://replicate.delivery/pbxt/HxvEFarJTY5yHqvu7p0jfPeFVsEwPgc3va2s1rPCBR8aDGxm/sketch-mountains-input.jpeg", "width": 512, "height": 512, "prompt": "A fantasy landscape, trending on artstation", "scheduler": "K_EULER_ANCESTRAL", "num_outputs": 1, "guidance_scale": 7.5, "prompt_strength": 0.8, "num_inference_steps": 25 } ) print(output)
To learn more, take a look at the guide on getting started with Python.
Run cjwbw/stable-diffusion-img2img-v2.1 using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
curl -s -X POST \ -H "Authorization: Bearer $REPLICATE_API_TOKEN" \ -H "Content-Type: application/json" \ -H "Prefer: wait" \ -d $'{ "version": "cjwbw/stable-diffusion-img2img-v2.1:650c347f19a96c8a0379db998c4cd092e0734534591b16a60df9942d11dec15b", "input": { "image": "https://replicate.delivery/pbxt/HxvEFarJTY5yHqvu7p0jfPeFVsEwPgc3va2s1rPCBR8aDGxm/sketch-mountains-input.jpeg", "width": 512, "height": 512, "prompt": "A fantasy landscape, trending on artstation", "scheduler": "K_EULER_ANCESTRAL", "num_outputs": 1, "guidance_scale": 7.5, "prompt_strength": 0.8, "num_inference_steps": 25 } }' \ https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
Output
{ "completed_at": "2022-12-15T21:37:56.202890Z", "created_at": "2022-12-15T21:37:50.712325Z", "data_removed": false, "error": null, "id": "b7bhjzdcc5fa3owrkskms4cpwa", "input": { "image": "https://replicate.delivery/pbxt/HxvEFarJTY5yHqvu7p0jfPeFVsEwPgc3va2s1rPCBR8aDGxm/sketch-mountains-input.jpeg", "width": 512, "height": 512, "prompt": "A fantasy landscape, trending on artstation", "scheduler": "K_EULER_ANCESTRAL", "num_outputs": 1, "guidance_scale": 7.5, "prompt_strength": 0.8, "num_inference_steps": 25 }, "logs": "Using seed: 3624\n 0%| | 0/20 [00:00<?, ?it/s]\n 5%|▌ | 1/20 [00:00<00:04, 4.52it/s]\n 10%|█ | 2/20 [00:00<00:03, 4.58it/s]\n 15%|█▌ | 3/20 [00:00<00:03, 4.60it/s]\n 20%|██ | 4/20 [00:00<00:03, 4.61it/s]\n 25%|██▌ | 5/20 [00:01<00:03, 4.62it/s]\n 30%|███ | 6/20 [00:01<00:03, 4.62it/s]\n 35%|███▌ | 7/20 [00:01<00:02, 4.63it/s]\n 40%|████ | 8/20 [00:01<00:02, 4.63it/s]\n 45%|████▌ | 9/20 [00:01<00:02, 4.63it/s]\n 50%|█████ | 10/20 [00:02<00:02, 4.61it/s]\n 55%|█████▌ | 11/20 [00:02<00:01, 4.62it/s]\n 60%|██████ | 12/20 [00:02<00:01, 4.62it/s]\n 65%|██████▌ | 13/20 [00:02<00:01, 4.63it/s]\n 70%|███████ | 14/20 [00:03<00:01, 4.63it/s]\n 75%|███████▌ | 15/20 [00:03<00:01, 4.63it/s]\n 80%|████████ | 16/20 [00:03<00:00, 4.63it/s]\n 85%|████████▌ | 17/20 [00:03<00:00, 4.63it/s]\n 90%|█████████ | 18/20 [00:03<00:00, 4.63it/s]\n 95%|█████████▌| 19/20 [00:04<00:00, 4.63it/s]\n100%|██████████| 20/20 [00:04<00:00, 4.63it/s]\n100%|██████████| 20/20 [00:04<00:00, 4.62it/s]", "metrics": { "predict_time": 5.453604, "total_time": 5.490565 }, "output": [ "https://replicate.delivery/pbxt/ZjObJxvppIqINNQskZ5Wtu2gArK2rd1L0QdDb2Y8AZ0sFlCE/out-0.png" ], "started_at": "2022-12-15T21:37:50.749286Z", "status": "succeeded", "urls": { "get": "https://api.replicate.com/v1/predictions/b7bhjzdcc5fa3owrkskms4cpwa", "cancel": "https://api.replicate.com/v1/predictions/b7bhjzdcc5fa3owrkskms4cpwa/cancel" }, "version": "650c347f19a96c8a0379db998c4cd092e0734534591b16a60df9942d11dec15b" }
Generated inUsing seed: 3624 0%| | 0/20 [00:00<?, ?it/s] 5%|▌ | 1/20 [00:00<00:04, 4.52it/s] 10%|█ | 2/20 [00:00<00:03, 4.58it/s] 15%|█▌ | 3/20 [00:00<00:03, 4.60it/s] 20%|██ | 4/20 [00:00<00:03, 4.61it/s] 25%|██▌ | 5/20 [00:01<00:03, 4.62it/s] 30%|███ | 6/20 [00:01<00:03, 4.62it/s] 35%|███▌ | 7/20 [00:01<00:02, 4.63it/s] 40%|████ | 8/20 [00:01<00:02, 4.63it/s] 45%|████▌ | 9/20 [00:01<00:02, 4.63it/s] 50%|█████ | 10/20 [00:02<00:02, 4.61it/s] 55%|█████▌ | 11/20 [00:02<00:01, 4.62it/s] 60%|██████ | 12/20 [00:02<00:01, 4.62it/s] 65%|██████▌ | 13/20 [00:02<00:01, 4.63it/s] 70%|███████ | 14/20 [00:03<00:01, 4.63it/s] 75%|███████▌ | 15/20 [00:03<00:01, 4.63it/s] 80%|████████ | 16/20 [00:03<00:00, 4.63it/s] 85%|████████▌ | 17/20 [00:03<00:00, 4.63it/s] 90%|█████████ | 18/20 [00:03<00:00, 4.63it/s] 95%|█████████▌| 19/20 [00:04<00:00, 4.63it/s] 100%|██████████| 20/20 [00:04<00:00, 4.63it/s] 100%|██████████| 20/20 [00:04<00:00, 4.62it/s]
Prediction
cjwbw/stable-diffusion-img2img-v2.1:650c347f19a96c8a0379db998c4cd092e0734534591b16a60df9942d11dec15bID4c63vdrl6bbtxhkn23k6q6rp2eStatusSucceededSourceWebHardware–Total durationCreatedInput
- width
- 512
- height
- 512
- prompt
- A fantasy landscape, trending on artstation
- scheduler
- K_EULER
- num_outputs
- 1
- guidance_scale
- 7.5
- prompt_strength
- 0.8
- num_inference_steps
- 25
{ "image": "https://replicate.delivery/pbxt/HxvEWoStnvDhP3Z8LSGEvnddgsLQc9cK66QCMvdwJylmWhGk/sketch-mountains-input.jpeg", "width": 512, "height": 512, "prompt": "A fantasy landscape, trending on artstation", "scheduler": "K_EULER", "num_outputs": 1, "guidance_scale": 7.5, "prompt_strength": 0.8, "num_inference_steps": 25 }
Install Replicate’s Node.js client library:npm install replicate
Import and set up the client:import Replicate from "replicate"; const replicate = new Replicate({ auth: process.env.REPLICATE_API_TOKEN, });
Run cjwbw/stable-diffusion-img2img-v2.1 using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run( "cjwbw/stable-diffusion-img2img-v2.1:650c347f19a96c8a0379db998c4cd092e0734534591b16a60df9942d11dec15b", { input: { image: "https://replicate.delivery/pbxt/HxvEWoStnvDhP3Z8LSGEvnddgsLQc9cK66QCMvdwJylmWhGk/sketch-mountains-input.jpeg", width: 512, height: 512, prompt: "A fantasy landscape, trending on artstation", scheduler: "K_EULER", num_outputs: 1, guidance_scale: 7.5, prompt_strength: 0.8, num_inference_steps: 25 } } ); // To access the file URL: console.log(output[0].url()); //=> "http://example.com" // To write the file to disk: fs.writeFile("my-image.png", output[0]);
To learn more, take a look at the guide on getting started with Node.js.
Install Replicate’s Python client library:pip install replicate
Import the client:import replicate
Run cjwbw/stable-diffusion-img2img-v2.1 using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run( "cjwbw/stable-diffusion-img2img-v2.1:650c347f19a96c8a0379db998c4cd092e0734534591b16a60df9942d11dec15b", input={ "image": "https://replicate.delivery/pbxt/HxvEWoStnvDhP3Z8LSGEvnddgsLQc9cK66QCMvdwJylmWhGk/sketch-mountains-input.jpeg", "width": 512, "height": 512, "prompt": "A fantasy landscape, trending on artstation", "scheduler": "K_EULER", "num_outputs": 1, "guidance_scale": 7.5, "prompt_strength": 0.8, "num_inference_steps": 25 } ) print(output)
To learn more, take a look at the guide on getting started with Python.
Run cjwbw/stable-diffusion-img2img-v2.1 using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
curl -s -X POST \ -H "Authorization: Bearer $REPLICATE_API_TOKEN" \ -H "Content-Type: application/json" \ -H "Prefer: wait" \ -d $'{ "version": "cjwbw/stable-diffusion-img2img-v2.1:650c347f19a96c8a0379db998c4cd092e0734534591b16a60df9942d11dec15b", "input": { "image": "https://replicate.delivery/pbxt/HxvEWoStnvDhP3Z8LSGEvnddgsLQc9cK66QCMvdwJylmWhGk/sketch-mountains-input.jpeg", "width": 512, "height": 512, "prompt": "A fantasy landscape, trending on artstation", "scheduler": "K_EULER", "num_outputs": 1, "guidance_scale": 7.5, "prompt_strength": 0.8, "num_inference_steps": 25 } }' \ https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
Output
{ "completed_at": "2022-12-15T21:38:14.462601Z", "created_at": "2022-12-15T21:38:08.539142Z", "data_removed": false, "error": null, "id": "4c63vdrl6bbtxhkn23k6q6rp2e", "input": { "image": "https://replicate.delivery/pbxt/HxvEWoStnvDhP3Z8LSGEvnddgsLQc9cK66QCMvdwJylmWhGk/sketch-mountains-input.jpeg", "width": 512, "height": 512, "prompt": "A fantasy landscape, trending on artstation", "scheduler": "K_EULER", "num_outputs": 1, "guidance_scale": 7.5, "prompt_strength": 0.8, "num_inference_steps": 25 }, "logs": "Using seed: 8716\n 0%| | 0/20 [00:00<?, ?it/s]\n 5%|▌ | 1/20 [00:00<00:04, 4.60it/s]\n 10%|█ | 2/20 [00:00<00:03, 4.61it/s]\n 15%|█▌ | 3/20 [00:00<00:03, 4.62it/s]\n 20%|██ | 4/20 [00:00<00:03, 4.62it/s]\n 25%|██▌ | 5/20 [00:01<00:03, 4.61it/s]\n 30%|███ | 6/20 [00:01<00:03, 4.61it/s]\n 35%|███▌ | 7/20 [00:01<00:02, 4.62it/s]\n 40%|████ | 8/20 [00:01<00:02, 4.62it/s]\n 45%|████▌ | 9/20 [00:01<00:02, 4.62it/s]\n 50%|█████ | 10/20 [00:02<00:02, 4.62it/s]\n 55%|█████▌ | 11/20 [00:02<00:01, 4.63it/s]\n 60%|██████ | 12/20 [00:02<00:01, 4.63it/s]\n 65%|██████▌ | 13/20 [00:02<00:01, 4.63it/s]\n 70%|███████ | 14/20 [00:03<00:01, 4.63it/s]\n 75%|███████▌ | 15/20 [00:03<00:01, 4.63it/s]\n 80%|████████ | 16/20 [00:03<00:00, 4.64it/s]\n 85%|████████▌ | 17/20 [00:03<00:00, 4.64it/s]\n 90%|█████████ | 18/20 [00:03<00:00, 4.62it/s]\n 95%|█████████▌| 19/20 [00:04<00:00, 4.63it/s]\n100%|██████████| 20/20 [00:04<00:00, 4.63it/s]\n100%|██████████| 20/20 [00:04<00:00, 4.63it/s]", "metrics": { "predict_time": 5.881789, "total_time": 5.923459 }, "output": [ "https://replicate.delivery/pbxt/HtG1SgSzGzqyP9FpoD69N4iPFPkeFQ2tejEca86yyuUFXUKQA/out-0.png" ], "started_at": "2022-12-15T21:38:08.580812Z", "status": "succeeded", "urls": { "get": "https://api.replicate.com/v1/predictions/4c63vdrl6bbtxhkn23k6q6rp2e", "cancel": "https://api.replicate.com/v1/predictions/4c63vdrl6bbtxhkn23k6q6rp2e/cancel" }, "version": "650c347f19a96c8a0379db998c4cd092e0734534591b16a60df9942d11dec15b" }
Generated inUsing seed: 8716 0%| | 0/20 [00:00<?, ?it/s] 5%|▌ | 1/20 [00:00<00:04, 4.60it/s] 10%|█ | 2/20 [00:00<00:03, 4.61it/s] 15%|█▌ | 3/20 [00:00<00:03, 4.62it/s] 20%|██ | 4/20 [00:00<00:03, 4.62it/s] 25%|██▌ | 5/20 [00:01<00:03, 4.61it/s] 30%|███ | 6/20 [00:01<00:03, 4.61it/s] 35%|███▌ | 7/20 [00:01<00:02, 4.62it/s] 40%|████ | 8/20 [00:01<00:02, 4.62it/s] 45%|████▌ | 9/20 [00:01<00:02, 4.62it/s] 50%|█████ | 10/20 [00:02<00:02, 4.62it/s] 55%|█████▌ | 11/20 [00:02<00:01, 4.63it/s] 60%|██████ | 12/20 [00:02<00:01, 4.63it/s] 65%|██████▌ | 13/20 [00:02<00:01, 4.63it/s] 70%|███████ | 14/20 [00:03<00:01, 4.63it/s] 75%|███████▌ | 15/20 [00:03<00:01, 4.63it/s] 80%|████████ | 16/20 [00:03<00:00, 4.64it/s] 85%|████████▌ | 17/20 [00:03<00:00, 4.64it/s] 90%|█████████ | 18/20 [00:03<00:00, 4.62it/s] 95%|█████████▌| 19/20 [00:04<00:00, 4.63it/s] 100%|██████████| 20/20 [00:04<00:00, 4.63it/s] 100%|██████████| 20/20 [00:04<00:00, 4.63it/s]
Prediction
cjwbw/stable-diffusion-img2img-v2.1:650c347f19a96c8a0379db998c4cd092e0734534591b16a60df9942d11dec15bInput
- width
- 512
- height
- 512
- prompt
- A fantasy landscape, trending on artstation
- scheduler
- PNDM
- num_outputs
- 1
- guidance_scale
- 7.5
- prompt_strength
- 0.8
- num_inference_steps
- 25
{ "image": "https://replicate.delivery/pbxt/HxvF6SylAmoaLQ3XLDhzTSvpF5xC2P3fzuvDB1bzMWgrQxJ6/sketch-mountains-input.jpeg", "width": 512, "height": 512, "prompt": "A fantasy landscape, trending on artstation", "scheduler": "PNDM", "num_outputs": 1, "guidance_scale": 7.5, "prompt_strength": 0.8, "num_inference_steps": 25 }
Install Replicate’s Node.js client library:npm install replicate
Import and set up the client:import Replicate from "replicate"; const replicate = new Replicate({ auth: process.env.REPLICATE_API_TOKEN, });
Run cjwbw/stable-diffusion-img2img-v2.1 using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run( "cjwbw/stable-diffusion-img2img-v2.1:650c347f19a96c8a0379db998c4cd092e0734534591b16a60df9942d11dec15b", { input: { image: "https://replicate.delivery/pbxt/HxvF6SylAmoaLQ3XLDhzTSvpF5xC2P3fzuvDB1bzMWgrQxJ6/sketch-mountains-input.jpeg", width: 512, height: 512, prompt: "A fantasy landscape, trending on artstation", scheduler: "PNDM", num_outputs: 1, guidance_scale: 7.5, prompt_strength: 0.8, num_inference_steps: 25 } } ); // To access the file URL: console.log(output[0].url()); //=> "http://example.com" // To write the file to disk: fs.writeFile("my-image.png", output[0]);
To learn more, take a look at the guide on getting started with Node.js.
Install Replicate’s Python client library:pip install replicate
Import the client:import replicate
Run cjwbw/stable-diffusion-img2img-v2.1 using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run( "cjwbw/stable-diffusion-img2img-v2.1:650c347f19a96c8a0379db998c4cd092e0734534591b16a60df9942d11dec15b", input={ "image": "https://replicate.delivery/pbxt/HxvF6SylAmoaLQ3XLDhzTSvpF5xC2P3fzuvDB1bzMWgrQxJ6/sketch-mountains-input.jpeg", "width": 512, "height": 512, "prompt": "A fantasy landscape, trending on artstation", "scheduler": "PNDM", "num_outputs": 1, "guidance_scale": 7.5, "prompt_strength": 0.8, "num_inference_steps": 25 } ) print(output)
To learn more, take a look at the guide on getting started with Python.
Run cjwbw/stable-diffusion-img2img-v2.1 using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
curl -s -X POST \ -H "Authorization: Bearer $REPLICATE_API_TOKEN" \ -H "Content-Type: application/json" \ -H "Prefer: wait" \ -d $'{ "version": "cjwbw/stable-diffusion-img2img-v2.1:650c347f19a96c8a0379db998c4cd092e0734534591b16a60df9942d11dec15b", "input": { "image": "https://replicate.delivery/pbxt/HxvF6SylAmoaLQ3XLDhzTSvpF5xC2P3fzuvDB1bzMWgrQxJ6/sketch-mountains-input.jpeg", "width": 512, "height": 512, "prompt": "A fantasy landscape, trending on artstation", "scheduler": "PNDM", "num_outputs": 1, "guidance_scale": 7.5, "prompt_strength": 0.8, "num_inference_steps": 25 } }' \ https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
Output
{ "completed_at": "2022-12-15T21:38:52.549592Z", "created_at": "2022-12-15T21:38:46.272742Z", "data_removed": false, "error": null, "id": "43kcb5kt2fglth44kec64wyr3q", "input": { "image": "https://replicate.delivery/pbxt/HxvF6SylAmoaLQ3XLDhzTSvpF5xC2P3fzuvDB1bzMWgrQxJ6/sketch-mountains-input.jpeg", "width": 512, "height": 512, "prompt": "A fantasy landscape, trending on artstation", "scheduler": "PNDM", "num_outputs": 1, "guidance_scale": 7.5, "prompt_strength": 0.8, "num_inference_steps": 25 }, "logs": "Using seed: 43031\n 0%| | 0/20 [00:00<?, ?it/s]\n 5%|▌ | 1/20 [00:00<00:08, 2.22it/s]\n 10%|█ | 2/20 [00:00<00:05, 3.20it/s]\n 15%|█▌ | 3/20 [00:00<00:04, 3.72it/s]\n 20%|██ | 4/20 [00:01<00:03, 4.03it/s]\n 25%|██▌ | 5/20 [00:01<00:03, 4.23it/s]\n 30%|███ | 6/20 [00:01<00:03, 4.36it/s]\n 35%|███▌ | 7/20 [00:01<00:02, 4.44it/s]\n 40%|████ | 8/20 [00:01<00:02, 4.50it/s]\n 45%|████▌ | 9/20 [00:02<00:02, 4.54it/s]\n 50%|█████ | 10/20 [00:02<00:02, 4.57it/s]\n 55%|█████▌ | 11/20 [00:02<00:01, 4.59it/s]\n 60%|██████ | 12/20 [00:02<00:01, 4.61it/s]\n 65%|██████▌ | 13/20 [00:03<00:01, 4.62it/s]\n 70%|███████ | 14/20 [00:03<00:01, 4.62it/s]\n 75%|███████▌ | 15/20 [00:03<00:01, 4.63it/s]\n 80%|████████ | 16/20 [00:03<00:00, 4.63it/s]\n 85%|████████▌ | 17/20 [00:03<00:00, 4.63it/s]\n 90%|█████████ | 18/20 [00:04<00:00, 4.64it/s]\n 95%|█████████▌| 19/20 [00:04<00:00, 4.63it/s]\n100%|██████████| 20/20 [00:04<00:00, 4.64it/s]\n100%|██████████| 20/20 [00:04<00:00, 4.40it/s]", "metrics": { "predict_time": 6.236609, "total_time": 6.27685 }, "output": [ "https://replicate.delivery/pbxt/uNKY6LvxoE5WO1sNxfyj6mbe6JzEB5tnbPh7tFV7okXrXUKQA/out-0.png" ], "started_at": "2022-12-15T21:38:46.312983Z", "status": "succeeded", "urls": { "get": "https://api.replicate.com/v1/predictions/43kcb5kt2fglth44kec64wyr3q", "cancel": "https://api.replicate.com/v1/predictions/43kcb5kt2fglth44kec64wyr3q/cancel" }, "version": "650c347f19a96c8a0379db998c4cd092e0734534591b16a60df9942d11dec15b" }
Generated inUsing seed: 43031 0%| | 0/20 [00:00<?, ?it/s] 5%|▌ | 1/20 [00:00<00:08, 2.22it/s] 10%|█ | 2/20 [00:00<00:05, 3.20it/s] 15%|█▌ | 3/20 [00:00<00:04, 3.72it/s] 20%|██ | 4/20 [00:01<00:03, 4.03it/s] 25%|██▌ | 5/20 [00:01<00:03, 4.23it/s] 30%|███ | 6/20 [00:01<00:03, 4.36it/s] 35%|███▌ | 7/20 [00:01<00:02, 4.44it/s] 40%|████ | 8/20 [00:01<00:02, 4.50it/s] 45%|████▌ | 9/20 [00:02<00:02, 4.54it/s] 50%|█████ | 10/20 [00:02<00:02, 4.57it/s] 55%|█████▌ | 11/20 [00:02<00:01, 4.59it/s] 60%|██████ | 12/20 [00:02<00:01, 4.61it/s] 65%|██████▌ | 13/20 [00:03<00:01, 4.62it/s] 70%|███████ | 14/20 [00:03<00:01, 4.62it/s] 75%|███████▌ | 15/20 [00:03<00:01, 4.63it/s] 80%|████████ | 16/20 [00:03<00:00, 4.63it/s] 85%|████████▌ | 17/20 [00:03<00:00, 4.63it/s] 90%|█████████ | 18/20 [00:04<00:00, 4.64it/s] 95%|█████████▌| 19/20 [00:04<00:00, 4.63it/s] 100%|██████████| 20/20 [00:04<00:00, 4.64it/s] 100%|██████████| 20/20 [00:04<00:00, 4.40it/s]
Want to make some of these yourself?
Run this model