Failed to load versions. Head to the versions page to see all versions for this model.
You're looking at a specific version of this model. Jump to the model overview.
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 nvidia/sana using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"nvidia/sana:0c65d5fd6b12e7c6f083e1f24c900eadfd0cb636a98ab6fa7a461337c256c1c1",
{
input: {
width: 1024,
height: 1024,
prompt: "Astronaut in a jungle, cold color palette, muted colors, detailed",
guidance_scale: 5,
negative_prompt: "",
pag_guidance_scale: 2,
num_inference_steps: 18
}
}
);
// To access the file URL:
console.log(output.url()); //=> "http://example.com"
// To write the file to disk:
fs.writeFile("my-image.png", 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 nvidia/sana using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"nvidia/sana:0c65d5fd6b12e7c6f083e1f24c900eadfd0cb636a98ab6fa7a461337c256c1c1",
input={
"width": 1024,
"height": 1024,
"prompt": "Astronaut in a jungle, cold color palette, muted colors, detailed",
"guidance_scale": 5,
"negative_prompt": "",
"pag_guidance_scale": 2,
"num_inference_steps": 18
}
)
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 nvidia/sana 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": "nvidia/sana:0c65d5fd6b12e7c6f083e1f24c900eadfd0cb636a98ab6fa7a461337c256c1c1",
"input": {
"width": 1024,
"height": 1024,
"prompt": "Astronaut in a jungle, cold color palette, muted colors, detailed",
"guidance_scale": 5,
"negative_prompt": "",
"pag_guidance_scale": 2,
"num_inference_steps": 18
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
Add a payment method to run this model.
By signing in, you agree to our
terms of service and privacy policy
Output
{
"completed_at": "2024-11-23T11:05:37.017594Z",
"created_at": "2024-11-23T11:05:35.870000Z",
"data_removed": false,
"error": null,
"id": "rndnxgpqfsrm80ckb2s99xcejg",
"input": {
"width": 1024,
"height": 1024,
"prompt": "Astronaut in a jungle, cold color palette, muted colors, detailed",
"guidance_scale": 5,
"negative_prompt": "",
"pag_guidance_scale": 2,
"num_inference_steps": 18
},
"logs": "Using seed: 61039\n 0%| | 0/17 [00:00<?, ?it/s]\n 18%|█▊ | 3/17 [00:00<00:00, 21.99it/s]\n 35%|███▌ | 6/17 [00:00<00:00, 22.06it/s]\n 53%|█████▎ | 9/17 [00:00<00:00, 22.07it/s]\n 71%|███████ | 12/17 [00:00<00:00, 22.09it/s]\n 88%|████████▊ | 15/17 [00:00<00:00, 22.10it/s]\n100%|██████████| 17/17 [00:00<00:00, 23.46it/s]",
"metrics": {
"predict_time": 1.141343185,
"total_time": 1.147594
},
"output": "https://replicate.delivery/xezq/UdVbPhKQrWJVG1lRjD4GgP9EIpujzfZXp2sweCsBaRDBk2zTA/output.png",
"started_at": "2024-11-23T11:05:35.876251Z",
"status": "succeeded",
"urls": {
"stream": "https://stream.replicate.com/v1/files/bcwr-tsickwqgfk6vtpdyckstdjme2lsbwfmx5qyvc5taldqjqu7p55xq",
"get": "https://api.replicate.com/v1/predictions/rndnxgpqfsrm80ckb2s99xcejg",
"cancel": "https://api.replicate.com/v1/predictions/rndnxgpqfsrm80ckb2s99xcejg/cancel"
},
"version": "0c65d5fd6b12e7c6f083e1f24c900eadfd0cb636a98ab6fa7a461337c256c1c1"
}
Using seed: 61039
0%| | 0/17 [00:00<?, ?it/s]
18%|█▊ | 3/17 [00:00<00:00, 21.99it/s]
35%|███▌ | 6/17 [00:00<00:00, 22.06it/s]
53%|█████▎ | 9/17 [00:00<00:00, 22.07it/s]
71%|███████ | 12/17 [00:00<00:00, 22.09it/s]
88%|████████▊ | 15/17 [00:00<00:00, 22.10it/s]
100%|██████████| 17/17 [00:00<00:00, 23.46it/s]