You're looking at a specific version of this model. Jump to the model overview.
cjwbw /stable-diffusion-v2:e5e1fd33
Input
Run this model in Node.js with one line of code:
npm install replicate
REPLICATE_API_TOKEN
environment variable:export REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
import Replicate from "replicate";
const replicate = new Replicate({
auth: process.env.REPLICATE_API_TOKEN,
});
Run cjwbw/stable-diffusion-v2 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-v2:e5e1fd333a08c8035974a01dd42f799f1cca4625aec374643d716d9ae40cf2e4",
{
input: {
width: 768,
height: 768,
prompt: "A fantasy landscape, trending on artstation",
scheduler: "DPMSolverMultistep",
init_image: "https://replicate.delivery/pbxt/HtCXRc5QMwvXfOOqx56gzsZcmTxmOwzSzN4CpzQj8q9pzaOt/sketch-mountains-input.jpeg",
num_outputs: 1,
guidance_scale: 6.55,
prompt_strength: 0.8,
num_inference_steps: 50
}
}
);
console.log(output);
To learn more, take a look at the guide on getting started with Node.js.
pip install replicate
REPLICATE_API_TOKEN
environment variable:export REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
import replicate
Run cjwbw/stable-diffusion-v2 using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"cjwbw/stable-diffusion-v2:e5e1fd333a08c8035974a01dd42f799f1cca4625aec374643d716d9ae40cf2e4",
input={
"width": 768,
"height": 768,
"prompt": "A fantasy landscape, trending on artstation",
"scheduler": "DPMSolverMultistep",
"init_image": "https://replicate.delivery/pbxt/HtCXRc5QMwvXfOOqx56gzsZcmTxmOwzSzN4CpzQj8q9pzaOt/sketch-mountains-input.jpeg",
"num_outputs": 1,
"guidance_scale": 6.55,
"prompt_strength": 0.8,
"num_inference_steps": 50
}
)
print(output)
To learn more, take a look at the guide on getting started with Python.
REPLICATE_API_TOKEN
environment variable:export REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
Run cjwbw/stable-diffusion-v2 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": "e5e1fd333a08c8035974a01dd42f799f1cca4625aec374643d716d9ae40cf2e4",
"input": {
"width": 768,
"height": 768,
"prompt": "A fantasy landscape, trending on artstation",
"scheduler": "DPMSolverMultistep",
"init_image": "https://replicate.delivery/pbxt/HtCXRc5QMwvXfOOqx56gzsZcmTxmOwzSzN4CpzQj8q9pzaOt/sketch-mountains-input.jpeg",
"num_outputs": 1,
"guidance_scale": 6.55,
"prompt_strength": 0.8,
"num_inference_steps": 50
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
brew install cog
If you don’t have Homebrew, there are other installation options available.
Run this to download the model and run it in your local environment:
cog predict r8.im/chenxwh/stable-diffusion-v2@sha256:e5e1fd333a08c8035974a01dd42f799f1cca4625aec374643d716d9ae40cf2e4 \
-i 'width=768' \
-i 'height=768' \
-i 'prompt="A fantasy landscape, trending on artstation"' \
-i 'scheduler="DPMSolverMultistep"' \
-i 'init_image="https://replicate.delivery/pbxt/HtCXRc5QMwvXfOOqx56gzsZcmTxmOwzSzN4CpzQj8q9pzaOt/sketch-mountains-input.jpeg"' \
-i 'num_outputs=1' \
-i 'guidance_scale=6.55' \
-i 'prompt_strength=0.8' \
-i 'num_inference_steps=50'
To learn more, take a look at the Cog documentation.
Run this to download the model and run it in your local environment:
docker run -d -p 5000:5000 --gpus=all r8.im/chenxwh/stable-diffusion-v2@sha256:e5e1fd333a08c8035974a01dd42f799f1cca4625aec374643d716d9ae40cf2e4
curl -s -X POST \ -H "Content-Type: application/json" \ -d $'{ "input": { "width": 768, "height": 768, "prompt": "A fantasy landscape, trending on artstation", "scheduler": "DPMSolverMultistep", "init_image": "https://replicate.delivery/pbxt/HtCXRc5QMwvXfOOqx56gzsZcmTxmOwzSzN4CpzQj8q9pzaOt/sketch-mountains-input.jpeg", "num_outputs": 1, "guidance_scale": 6.55, "prompt_strength": 0.8, "num_inference_steps": 50 } }' \ http://localhost:5000/predictions
To learn more, take a look at the Cog documentation.
Add a payment method to run this model.
Each run costs approximately $0.032. Alternatively, try out our featured models for free.
By signing in, you agree to our
terms of service and privacy policy
Output
{
"completed_at": "2022-12-02T14:26:20.502898Z",
"created_at": "2022-12-02T14:26:15.162182Z",
"data_removed": false,
"error": null,
"id": "gxbijslwz5bbfffjr7y22j765e",
"input": {
"width": "768",
"height": 768,
"prompt": "A fantasy landscape, trending on artstation",
"scheduler": "DPMSolverMultistep",
"init_image": "https://replicate.delivery/pbxt/HtCXRc5QMwvXfOOqx56gzsZcmTxmOwzSzN4CpzQj8q9pzaOt/sketch-mountains-input.jpeg",
"num_outputs": 1,
"guidance_scale": "6.55",
"prompt_strength": 0.8,
"num_inference_steps": "50"
},
"logs": "Using seed: 54338\n 0%| | 0/40 [00:00<?, ?it/s]\n 2%|▎ | 1/40 [00:00<00:04, 8.46it/s]\n 8%|▊ | 3/40 [00:00<00:03, 9.95it/s]\n 12%|█▎ | 5/40 [00:00<00:03, 10.28it/s]\n 18%|█▊ | 7/40 [00:00<00:03, 10.42it/s]\n 22%|██▎ | 9/40 [00:00<00:02, 10.49it/s]\n 28%|██▊ | 11/40 [00:01<00:02, 10.53it/s]\n 32%|███▎ | 13/40 [00:01<00:02, 10.55it/s]\n 38%|███▊ | 15/40 [00:01<00:02, 10.57it/s]\n 42%|████▎ | 17/40 [00:01<00:02, 10.58it/s]\n 48%|████▊ | 19/40 [00:01<00:01, 10.59it/s]\n 52%|█████▎ | 21/40 [00:02<00:01, 10.60it/s]\n 57%|█████▊ | 23/40 [00:02<00:01, 10.59it/s]\n 62%|██████▎ | 25/40 [00:02<00:01, 10.59it/s]\n 68%|██████▊ | 27/40 [00:02<00:01, 10.60it/s]\n 72%|███████▎ | 29/40 [00:02<00:01, 10.60it/s]\n 78%|███████▊ | 31/40 [00:02<00:00, 10.60it/s]\n 82%|████████▎ | 33/40 [00:03<00:00, 10.60it/s]\n 88%|████████▊ | 35/40 [00:03<00:00, 10.60it/s]\n 92%|█████████▎| 37/40 [00:03<00:00, 10.60it/s]\n 98%|█████████▊| 39/40 [00:03<00:00, 10.60it/s]\n100%|██████████| 40/40 [00:03<00:00, 10.54it/s]",
"metrics": {
"predict_time": 5.304438,
"total_time": 5.340716
},
"output": [
"https://replicate.delivery/pbxt/EtsePYmau0VxLCzVZVafWf7WSYnu9NabtVrD7fJlD86uQvXAB/out-0.png"
],
"started_at": "2022-12-02T14:26:15.198460Z",
"status": "succeeded",
"urls": {
"get": "https://api.replicate.com/v1/predictions/gxbijslwz5bbfffjr7y22j765e",
"cancel": "https://api.replicate.com/v1/predictions/gxbijslwz5bbfffjr7y22j765e/cancel"
},
"version": "e5e1fd333a08c8035974a01dd42f799f1cca4625aec374643d716d9ae40cf2e4"
}
Using seed: 54338
0%| | 0/40 [00:00<?, ?it/s]
2%|▎ | 1/40 [00:00<00:04, 8.46it/s]
8%|▊ | 3/40 [00:00<00:03, 9.95it/s]
12%|█▎ | 5/40 [00:00<00:03, 10.28it/s]
18%|█▊ | 7/40 [00:00<00:03, 10.42it/s]
22%|██▎ | 9/40 [00:00<00:02, 10.49it/s]
28%|██▊ | 11/40 [00:01<00:02, 10.53it/s]
32%|███▎ | 13/40 [00:01<00:02, 10.55it/s]
38%|███▊ | 15/40 [00:01<00:02, 10.57it/s]
42%|████▎ | 17/40 [00:01<00:02, 10.58it/s]
48%|████▊ | 19/40 [00:01<00:01, 10.59it/s]
52%|█████▎ | 21/40 [00:02<00:01, 10.60it/s]
57%|█████▊ | 23/40 [00:02<00:01, 10.59it/s]
62%|██████▎ | 25/40 [00:02<00:01, 10.59it/s]
68%|██████▊ | 27/40 [00:02<00:01, 10.60it/s]
72%|███████▎ | 29/40 [00:02<00:01, 10.60it/s]
78%|███████▊ | 31/40 [00:02<00:00, 10.60it/s]
82%|████████▎ | 33/40 [00:03<00:00, 10.60it/s]
88%|████████▊ | 35/40 [00:03<00:00, 10.60it/s]
92%|█████████▎| 37/40 [00:03<00:00, 10.60it/s]
98%|█████████▊| 39/40 [00:03<00:00, 10.60it/s]
100%|██████████| 40/40 [00:03<00:00, 10.54it/s]