defaulta vision of paradise. unreal engine
typetext
{
"guidance_scale": 7.5,
"image_dimensions": "768x768",
"num_inference_steps": 50,
"num_outputs": "1",
"prompt": "alpacas with party hats and confetti",
"scheduler": "K_EULER"
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_UOH**********************************
This is your API token. Keep it to yourself.
import Replicate from "replicate";
import fs from "node:fs";
const replicate = new Replicate({
auth: process.env.REPLICATE_API_TOKEN,
});
Run stability-ai/stable-diffusion using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"stability-ai/stable-diffusion:db21e45d3f7023abc2a46ee38a23973f6dce16bb082a930b0c49861f96d1e5bf",
{
input: {
guidance_scale: 7.5,
image_dimensions: "768x768",
num_inference_steps: 50,
num_outputs: "1",
prompt: "alpacas with party hats and confetti",
scheduler: "K_EULER"
}
}
);
// 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.
pip install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_UOH**********************************
This is your API token. Keep it to yourself.
import replicate
Run stability-ai/stable-diffusion using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"stability-ai/stable-diffusion:db21e45d3f7023abc2a46ee38a23973f6dce16bb082a930b0c49861f96d1e5bf",
input={
"guidance_scale": 7.5,
"image_dimensions": "768x768",
"num_inference_steps": 50,
"num_outputs": "1",
"prompt": "alpacas with party hats and confetti",
"scheduler": "K_EULER"
}
)
# To access the file URL:
print(output[0].url())
#=> "http://example.com"
# To write the file to disk:
with open("my-image.png", "wb") as file:
file.write(output[0].read())
To learn more, take a look at the guide on getting started with Python.
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_UOH**********************************
This is your API token. Keep it to yourself.
Run stability-ai/stable-diffusion 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": "stability-ai/stable-diffusion:db21e45d3f7023abc2a46ee38a23973f6dce16bb082a930b0c49861f96d1e5bf",
"input": {
"guidance_scale": 7.5,
"image_dimensions": "768x768",
"num_inference_steps": 50,
"num_outputs": "1",
"prompt": "alpacas with party hats and confetti",
"scheduler": "K_EULER"
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "ddqxefjhgjeedcva656ybam6pi",
"model": "stability-ai/stable-diffusion",
"version": "db21e45d3f7023abc2a46ee38a23973f6dce16bb082a930b0c49861f96d1e5bf",
"input": {
"guidance_scale": 7.5,
"image_dimensions": "768x768",
"num_inference_steps": 50,
"num_outputs": "1",
"prompt": "alpacas with party hats and confetti",
"scheduler": "K_EULER"
},
"logs": "Using seed: 21183\ninput_shape: torch.Size([1, 77])\n 0%| | 0/50 [00:00<?, ?it/s]\n 4%|▍ | 2/50 [00:00<00:02, 17.01it/s]\n 8%|▊ | 4/50 [00:00<00:02, 16.97it/s]\n 14%|█▍ | 7/50 [00:00<00:02, 19.13it/s]\n 20%|██ | 10/50 [00:00<00:01, 20.04it/s]\n 26%|██▌ | 13/50 [00:00<00:01, 20.56it/s]\n 32%|███▏ | 16/50 [00:00<00:01, 20.83it/s]\n 38%|███▊ | 19/50 [00:00<00:01, 21.01it/s]\n 44%|████▍ | 22/50 [00:01<00:01, 21.13it/s]\n 50%|█████ | 25/50 [00:01<00:01, 21.19it/s]\n 56%|█████▌ | 28/50 [00:01<00:01, 21.24it/s]\n 62%|██████▏ | 31/50 [00:01<00:00, 21.12it/s]\n 68%|██████▊ | 34/50 [00:01<00:00, 21.21it/s]\n 74%|███████▍ | 37/50 [00:01<00:00, 21.27it/s]\n 80%|████████ | 40/50 [00:01<00:00, 21.25it/s]\n 86%|████████▌ | 43/50 [00:02<00:00, 21.30it/s]\n 92%|█████████▏| 46/50 [00:02<00:00, 21.33it/s]\n 98%|█████████▊| 49/50 [00:02<00:00, 21.35it/s]\n100%|██████████| 50/50 [00:02<00:00, 20.89it/s]",
"output": [
"https://replicate.delivery/pbxt/9g70grxOV87KG9BhjBLkzwoGTAwb336P6cXDImEVaZOUpDKE/out-0.png"
],
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2023-03-16T15:35:41.367457Z",
"started_at": "2023-03-16T15:35:41.451596Z",
"completed_at": "2023-03-16T15:35:45.06837Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/ddqxefjhgjeedcva656ybam6pi/cancel",
"get": "https://api.replicate.com/v1/predictions/ddqxefjhgjeedcva656ybam6pi"
},
"metrics": {
"predict_time": 3.616774,
"total_time": 3.700913
}
}