typetext
{
"aspect_ratio": "1:1",
"extra_lora_scale": 1,
"go_fast": false,
"guidance_scale": 8,
"lora_scale": 1,
"megapixels": "1",
"model": "dev",
"num_inference_steps": 35,
"num_outputs": 1,
"output_format": "webp",
"output_quality": 80,
"prompt": "a photo of ASTREA washing in shorts a Purple Lamborghini diablo, no glasses, in Miami",
"prompt_strength": 0.9
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_DDo**********************************
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 cesarvega/my-model-astrea-v2 using Replicateβs API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"cesarvega/my-model-astrea-v2:5f41e3976581ee396f2d589d517d93a01551b4b6079361799f2dc1bfde9fe3c6",
{
input: {
aspect_ratio: "1:1",
extra_lora_scale: 1,
go_fast: false,
guidance_scale: 8,
lora_scale: 1,
megapixels: "1",
model: "dev",
num_inference_steps: 35,
num_outputs: 1,
output_format: "webp",
output_quality: 80,
prompt: "a photo of ASTREA washing in shorts a Purple Lamborghini diablo, no glasses, in Miami",
prompt_strength: 0.9
}
}
);
// 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_DDo**********************************
This is your API token. Keep it to yourself.
import replicate
Run cesarvega/my-model-astrea-v2 using Replicateβs API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"cesarvega/my-model-astrea-v2:5f41e3976581ee396f2d589d517d93a01551b4b6079361799f2dc1bfde9fe3c6",
input={
"aspect_ratio": "1:1",
"extra_lora_scale": 1,
"go_fast": False,
"guidance_scale": 8,
"lora_scale": 1,
"megapixels": "1",
"model": "dev",
"num_inference_steps": 35,
"num_outputs": 1,
"output_format": "webp",
"output_quality": 80,
"prompt": "a photo of ASTREA washing in shorts a Purple Lamborghini diablo, no glasses, in Miami",
"prompt_strength": 0.9
}
)
# 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_DDo**********************************
This is your API token. Keep it to yourself.
Run cesarvega/my-model-astrea-v2 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": "cesarvega/my-model-astrea-v2:5f41e3976581ee396f2d589d517d93a01551b4b6079361799f2dc1bfde9fe3c6",
"input": {
"aspect_ratio": "1:1",
"extra_lora_scale": 1,
"go_fast": false,
"guidance_scale": 8,
"lora_scale": 1,
"megapixels": "1",
"model": "dev",
"num_inference_steps": 35,
"num_outputs": 1,
"output_format": "webp",
"output_quality": 80,
"prompt": "a photo of ASTREA washing in shorts a Purple Lamborghini diablo, no glasses, in Miami",
"prompt_strength": 0.9
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicateβs HTTP API reference docs.
{
"id": "6wakv9adwxrme0cmwvrv5t64mr",
"model": "cesarvega/my-model-astrea-v2",
"version": "5f41e3976581ee396f2d589d517d93a01551b4b6079361799f2dc1bfde9fe3c6",
"input": {
"aspect_ratio": "1:1",
"extra_lora_scale": 1,
"go_fast": false,
"guidance_scale": 8,
"lora_scale": 1,
"megapixels": "1",
"model": "dev",
"num_inference_steps": 35,
"num_outputs": 1,
"output_format": "webp",
"output_quality": 80,
"prompt": "a photo of ASTREA washing in shorts a Purple Lamborghini diablo, no glasses, in Miami",
"prompt_strength": 0.9
},
"logs": "free=28983736700928\nDownloading weights\n2025-02-08T19:02:41Z | INFO | [ Initiating ] chunk_size=150M dest=/tmp/tmpzcro1s23/weights url=https://replicate.delivery/xezq/EAQLA1eQ6BSMAK4GIWo88tcuHo7VeJfD4ItCwpeKEeCy1sqhC/trained_model.tar\n2025-02-08T19:02:43Z | INFO | [ Complete ] dest=/tmp/tmpzcro1s23/weights size=\"172 MB\" total_elapsed=2.109s url=https://replicate.delivery/xezq/EAQLA1eQ6BSMAK4GIWo88tcuHo7VeJfD4ItCwpeKEeCy1sqhC/trained_model.tar\nDownloaded weights in 2.14s\nLoaded LoRAs in 2.68s\nUsing seed: 30537\nPrompt: a photo of ASTREA washing in shorts a Purple Lamborghini diablo, no glasses, in Miami\n[!] txt2img mode\n 0%| | 0/35 [00:00<?, ?it/s]\n 3%|β | 1/35 [00:00<00:08, 4.07it/s]\n 6%|β | 2/35 [00:00<00:07, 4.57it/s]\n 9%|β | 3/35 [00:00<00:07, 4.32it/s]\n 11%|ββ | 4/35 [00:00<00:07, 4.22it/s]\n 14%|ββ | 5/35 [00:01<00:07, 4.17it/s]\n 17%|ββ | 6/35 [00:01<00:07, 4.13it/s]\n 20%|ββ | 7/35 [00:01<00:06, 4.12it/s]\n 23%|βββ | 8/35 [00:01<00:06, 4.09it/s]\n 26%|βββ | 9/35 [00:02<00:06, 4.08it/s]\n 29%|βββ | 10/35 [00:02<00:06, 4.08it/s]\n 31%|ββββ | 11/35 [00:02<00:05, 4.07it/s]\n 34%|ββββ | 12/35 [00:02<00:05, 4.06it/s]\n 37%|ββββ | 13/35 [00:03<00:05, 4.05it/s]\n 40%|ββββ | 14/35 [00:03<00:05, 4.06it/s]\n 43%|βββββ | 15/35 [00:03<00:04, 4.06it/s]\n 46%|βββββ | 16/35 [00:03<00:04, 4.06it/s]\n 49%|βββββ | 17/35 [00:04<00:04, 4.06it/s]\n 51%|ββββββ | 18/35 [00:04<00:04, 4.06it/s]\n 54%|ββββββ | 19/35 [00:04<00:03, 4.06it/s]\n 57%|ββββββ | 20/35 [00:04<00:03, 4.07it/s]\n 60%|ββββββ | 21/35 [00:05<00:03, 4.06it/s]\n 63%|βββββββ | 22/35 [00:05<00:03, 4.05it/s]\n 66%|βββββββ | 23/35 [00:05<00:02, 4.05it/s]\n 69%|βββββββ | 24/35 [00:05<00:02, 4.06it/s]\n 71%|ββββββββ | 25/35 [00:06<00:02, 4.06it/s]\n 74%|ββββββββ | 26/35 [00:06<00:02, 4.06it/s]\n 77%|ββββββββ | 27/35 [00:06<00:01, 4.05it/s]\n 80%|ββββββββ | 28/35 [00:06<00:01, 4.05it/s]\n 83%|βββββββββ | 29/35 [00:07<00:01, 4.05it/s]\n 86%|βββββββββ | 30/35 [00:07<00:01, 4.06it/s]\n 89%|βββββββββ | 31/35 [00:07<00:00, 4.06it/s]\n 91%|ββββββββββ| 32/35 [00:07<00:00, 4.05it/s]\n 94%|ββββββββββ| 33/35 [00:08<00:00, 4.05it/s]\n 97%|ββββββββββ| 34/35 [00:08<00:00, 4.05it/s]\n100%|ββββββββββ| 35/35 [00:08<00:00, 4.05it/s]\n100%|ββββββββββ| 35/35 [00:08<00:00, 4.08it/s]\nTotal safe images: 1 out of 1",
"output": [
"https://replicate.delivery/xezq/YNGeJVntAu3waymymcOaowxvqOBC2hoQwdF8LHC6neRcxVNUA/out-0.webp"
],
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2025-02-08T19:02:41.383Z",
"started_at": "2025-02-08T19:02:41.437763Z",
"completed_at": "2025-02-08T19:02:52.981879Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/6wakv9adwxrme0cmwvrv5t64mr/cancel",
"get": "https://api.replicate.com/v1/predictions/6wakv9adwxrme0cmwvrv5t64mr",
"stream": "https://stream.replicate.com/v1/files/bcwr-shkef4mv5cfldcpeledfjq55ay4a2h4dbuw4fa2643rndkrcybqq",
"web": "https://replicate.com/p/6wakv9adwxrme0cmwvrv5t64mr"
},
"metrics": {
"predict_time": 11.544115546,
"total_time": 11.598879
}
}