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:88312dcb9eaa543d7f8721e092053e8bb901a45a5d3c63c84e0a5aa7c247df33",
{
input: {
width: 1024,
height: 1024,
prompt: "a cyberpunk cat with a neon sign that says \"Sana\"",
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:88312dcb9eaa543d7f8721e092053e8bb901a45a5d3c63c84e0a5aa7c247df33",
input={
"width": 1024,
"height": 1024,
"prompt": "a cyberpunk cat with a neon sign that says \"Sana\"",
"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:88312dcb9eaa543d7f8721e092053e8bb901a45a5d3c63c84e0a5aa7c247df33",
"input": {
"width": 1024,
"height": 1024,
"prompt": "a cyberpunk cat with a neon sign that says \\"Sana\\"",
"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-24T01:20:08.636722Z",
"created_at": "2024-11-24T01:20:07.431000Z",
"data_removed": false,
"error": null,
"id": "zj27sz9f0xrma0ckbf0v455ypm",
"input": {
"width": 1024,
"height": 1024,
"prompt": "a cyberpunk cat with a neon sign that says \"Sana\"",
"guidance_scale": 5,
"negative_prompt": "",
"pag_guidance_scale": 2,
"num_inference_steps": 18
},
"logs": "Using seed: 49609\n 0%| | 0/17 [00:00<?, ?it/s]\n 18%|█▊ | 3/17 [00:00<00:00, 22.20it/s]\n 35%|███▌ | 6/17 [00:00<00:00, 22.18it/s]\n 53%|█████▎ | 9/17 [00:00<00:00, 22.17it/s]\n 71%|███████ | 12/17 [00:00<00:00, 22.17it/s]\n 88%|████████▊ | 15/17 [00:00<00:00, 22.17it/s]\n100%|██████████| 17/17 [00:00<00:00, 23.56it/s]",
"metrics": {
"predict_time": 1.198414056,
"total_time": 1.205722
},
"output": "https://replicate.delivery/xezq/SRGSBB0ygzb3JVkLCW2A0Kofze4aD1KqHa2KOoW9oeejUMQPB/output.png",
"started_at": "2024-11-24T01:20:07.438308Z",
"status": "succeeded",
"urls": {
"stream": "https://stream.replicate.com/v1/files/bcwr-vdagiyuf62kw5uzmjpckui5yvzja7tso6ttlqcec7mb6qhghxpfa",
"get": "https://api.replicate.com/v1/predictions/zj27sz9f0xrma0ckbf0v455ypm",
"cancel": "https://api.replicate.com/v1/predictions/zj27sz9f0xrma0ckbf0v455ypm/cancel"
},
"version": "88312dcb9eaa543d7f8721e092053e8bb901a45a5d3c63c84e0a5aa7c247df33"
}
Using seed: 49609
0%| | 0/17 [00:00<?, ?it/s]
18%|█▊ | 3/17 [00:00<00:00, 22.20it/s]
35%|███▌ | 6/17 [00:00<00:00, 22.18it/s]
53%|█████▎ | 9/17 [00:00<00:00, 22.17it/s]
71%|███████ | 12/17 [00:00<00:00, 22.17it/s]
88%|████████▊ | 15/17 [00:00<00:00, 22.17it/s]
100%|██████████| 17/17 [00:00<00:00, 23.56it/s]