defaulta vision of paradise. unreal engine
typetext
{
"guidance_scale": 7.5,
"image_dimensions": "512x512",
"num_inference_steps": 50,
"num_outputs": 1,
"prompt": "an astronaut riding a horse on mars, hd, dramatic lighting",
"scheduler": "K_EULER"
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_Fr3**********************************
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: "512x512",
num_inference_steps: 50,
num_outputs: 1,
prompt: "an astronaut riding a horse on mars, hd, dramatic lighting",
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_Fr3**********************************
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": "512x512",
"num_inference_steps": 50,
"num_outputs": 1,
"prompt": "an astronaut riding a horse on mars, hd, dramatic lighting",
"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_Fr3**********************************
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": "512x512",
"num_inference_steps": 50,
"num_outputs": 1,
"prompt": "an astronaut riding a horse on mars, hd, dramatic lighting",
"scheduler": "K_EULER"
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "uvb7ynit4bhpjds3vn4bx7npeq",
"model": "stability-ai/stable-diffusion",
"version": "db21e45d3f7023abc2a46ee38a23973f6dce16bb082a930b0c49861f96d1e5bf",
"input": {
"guidance_scale": 7.5,
"image_dimensions": "512x512",
"num_inference_steps": 50,
"num_outputs": 1,
"prompt": "an astronaut riding a horse on mars, hd, dramatic lighting",
"scheduler": "K_EULER"
},
"logs": "Using seed: 52443\ninput_shape: torch.Size([1, 77])\n 0%| | 0/50 [00:00<?, ?it/s]\n 10%|█ | 5/50 [00:00<00:01, 41.06it/s]\n 20%|██ | 10/50 [00:00<00:00, 41.32it/s]\n 30%|███ | 15/50 [00:00<00:00, 43.77it/s]\n 42%|████▏ | 21/50 [00:00<00:00, 46.80it/s]\n 54%|█████▍ | 27/50 [00:00<00:00, 48.53it/s]\n 66%|██████▌ | 33/50 [00:00<00:00, 49.63it/s]\n 78%|███████▊ | 39/50 [00:00<00:00, 50.45it/s]\n 90%|█████████ | 45/50 [00:00<00:00, 50.90it/s]\n100%|██████████| 50/50 [00:01<00:00, 48.51it/s]",
"output": [
"https://replicate.delivery/pbxt/sWeZFZou6v3CPKuoJbqX46ugPaHT1DcsWYx0srPmGrMOCPYIA/out-0.png"
],
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2023-04-10T15:45:31.434998Z",
"started_at": "2023-04-10T15:45:31.585022Z",
"completed_at": "2023-04-10T15:45:33.474978Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/uvb7ynit4bhpjds3vn4bx7npeq/cancel",
"get": "https://api.replicate.com/v1/predictions/uvb7ynit4bhpjds3vn4bx7npeq"
},
"metrics": {
"predict_time": 1.889956,
"total_time": 2.03998
}
}