defaultA small cactus with a happy face in the Sahara desert
typetext
{
"guidance_scale": 4.5,
"height": 1024,
"num_inference_steps": 14,
"num_outputs": 1,
"prompt": "an astronaut sitting in a diner, eating fries, cinematic, analog film",
"scheduler": "DPMSolverMultistep",
"style": "None",
"width": 1024
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_GiB**********************************
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 lucataco/pixart-xl-2 using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"lucataco/pixart-xl-2:816c99673841b9448bc2539834c16d40e0315bbf92fef0317b57a226727409bb",
{
input: {
guidance_scale: 4.5,
height: 1024,
num_inference_steps: 14,
num_outputs: 1,
prompt: "an astronaut sitting in a diner, eating fries, cinematic, analog film",
scheduler: "DPMSolverMultistep",
style: "None",
width: 1024
}
}
);
// 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_GiB**********************************
This is your API token. Keep it to yourself.
import replicate
Run lucataco/pixart-xl-2 using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"lucataco/pixart-xl-2:816c99673841b9448bc2539834c16d40e0315bbf92fef0317b57a226727409bb",
input={
"guidance_scale": 4.5,
"height": 1024,
"num_inference_steps": 14,
"num_outputs": 1,
"prompt": "an astronaut sitting in a diner, eating fries, cinematic, analog film",
"scheduler": "DPMSolverMultistep",
"style": "None",
"width": 1024
}
)
# 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_GiB**********************************
This is your API token. Keep it to yourself.
Run lucataco/pixart-xl-2 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": "lucataco/pixart-xl-2:816c99673841b9448bc2539834c16d40e0315bbf92fef0317b57a226727409bb",
"input": {
"guidance_scale": 4.5,
"height": 1024,
"num_inference_steps": 14,
"num_outputs": 1,
"prompt": "an astronaut sitting in a diner, eating fries, cinematic, analog film",
"scheduler": "DPMSolverMultistep",
"style": "None",
"width": 1024
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "o23ccgdbvi46p2uvxuqrhoccry",
"model": "lucataco/pixart-xl-2",
"version": "816c99673841b9448bc2539834c16d40e0315bbf92fef0317b57a226727409bb",
"input": {
"guidance_scale": 4.5,
"height": 1024,
"num_inference_steps": 14,
"num_outputs": 1,
"prompt": "an astronaut sitting in a diner, eating fries, cinematic, analog film",
"scheduler": "DPMSolverMultistep",
"style": "None",
"width": 1024
},
"logs": "Using seed: 255397398\nPrompt: an astronaut sitting in a diner, eating fries, cinematic, analog film Negative Prompt: None\n 0%| | 0/14 [00:00<?, ?it/s]\n 7%|▋ | 1/14 [00:00<00:04, 2.86it/s]\n 14%|█▍ | 2/14 [00:00<00:03, 3.16it/s]\n 21%|██▏ | 3/14 [00:00<00:03, 3.26it/s]\n 29%|██▊ | 4/14 [00:01<00:03, 3.29it/s]\n 36%|███▌ | 5/14 [00:01<00:02, 3.32it/s]\n 43%|████▎ | 6/14 [00:01<00:02, 3.34it/s]\n 50%|█████ | 7/14 [00:02<00:02, 3.35it/s]\n 57%|█████▋ | 8/14 [00:02<00:01, 3.36it/s]\n 64%|██████▍ | 9/14 [00:02<00:01, 3.36it/s]\n 71%|███████▏ | 10/14 [00:03<00:01, 3.36it/s]\n 79%|███████▊ | 11/14 [00:03<00:00, 3.36it/s]\n 86%|████████▌ | 12/14 [00:03<00:00, 3.36it/s]\n 93%|█████████▎| 13/14 [00:03<00:00, 3.36it/s]\n100%|██████████| 14/14 [00:04<00:00, 3.36it/s]\n100%|██████████| 14/14 [00:04<00:00, 3.33it/s]",
"output": [
"https://replicate.delivery/pbxt/nSBVHLqeoD1KECVJ5OJSm90ihtI0zm4qeBvQ9ACZNMQUfg9jA/out-0.png"
],
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2023-12-04T04:27:50.578331Z",
"started_at": "2023-12-04T04:30:07.171124Z",
"completed_at": "2023-12-04T04:30:13.212351Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/o23ccgdbvi46p2uvxuqrhoccry/cancel",
"get": "https://api.replicate.com/v1/predictions/o23ccgdbvi46p2uvxuqrhoccry"
},
"metrics": {
"predict_time": 6.041227,
"total_time": 142.63402
}
}