typetext
{
"aspect_ratio": "1:1",
"extra_lora_scale": 1,
"go_fast": false,
"guidance_scale": 3,
"lora_scale": 1,
"megapixels": "1",
"model": "dev",
"num_inference_steps": 28,
"num_outputs": 4,
"output_format": "webp",
"output_quality": 80,
"prompt": "a digital illustration of PURR reading a book in a cozy library",
"prompt_strength": 1
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_8Br**********************************
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 lastmover/purr2 using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"lastmover/purr2:19e5239358c8ecbc81acad82cd146ba16b5c6f4b52375cd170db578ece68b0f5",
{
input: {
aspect_ratio: "1:1",
extra_lora_scale: 1,
go_fast: false,
guidance_scale: 3,
lora_scale: 1,
megapixels: "1",
model: "dev",
num_inference_steps: 28,
num_outputs: 4,
output_format: "webp",
output_quality: 80,
prompt: "a digital illustration of PURR reading a book in a cozy library",
prompt_strength: 1
}
}
);
// 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_8Br**********************************
This is your API token. Keep it to yourself.
import replicate
Run lastmover/purr2 using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"lastmover/purr2:19e5239358c8ecbc81acad82cd146ba16b5c6f4b52375cd170db578ece68b0f5",
input={
"aspect_ratio": "1:1",
"extra_lora_scale": 1,
"go_fast": False,
"guidance_scale": 3,
"lora_scale": 1,
"megapixels": "1",
"model": "dev",
"num_inference_steps": 28,
"num_outputs": 4,
"output_format": "webp",
"output_quality": 80,
"prompt": "a digital illustration of PURR reading a book in a cozy library",
"prompt_strength": 1
}
)
# 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_8Br**********************************
This is your API token. Keep it to yourself.
Run lastmover/purr2 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": "lastmover/purr2:19e5239358c8ecbc81acad82cd146ba16b5c6f4b52375cd170db578ece68b0f5",
"input": {
"aspect_ratio": "1:1",
"extra_lora_scale": 1,
"go_fast": false,
"guidance_scale": 3,
"lora_scale": 1,
"megapixels": "1",
"model": "dev",
"num_inference_steps": 28,
"num_outputs": 4,
"output_format": "webp",
"output_quality": 80,
"prompt": "a digital illustration of PURR reading a book in a cozy library",
"prompt_strength": 1
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "kkhk9tt45srm80cmnabv871gec",
"model": "lastmover/purr2",
"version": "19e5239358c8ecbc81acad82cd146ba16b5c6f4b52375cd170db578ece68b0f5",
"input": {
"aspect_ratio": "1:1",
"extra_lora_scale": 1,
"go_fast": false,
"guidance_scale": 3,
"lora_scale": 1,
"megapixels": "1",
"model": "dev",
"num_inference_steps": 28,
"num_outputs": 4,
"output_format": "webp",
"output_quality": 80,
"prompt": "a digital illustration of PURR reading a book in a cozy library",
"prompt_strength": 1
},
"logs": "2025-01-28 01:47:08.531 | DEBUG | fp8.lora_loading:apply_lora_to_model:574 - Extracting keys\n2025-01-28 01:47:08.532 | DEBUG | fp8.lora_loading:apply_lora_to_model:581 - Keys extracted\nApplying LoRA: 0%| | 0/304 [00:00<?, ?it/s]\nApplying LoRA: 89%|████████▉ | 270/304 [00:00<00:00, 2674.82it/s]\nApplying LoRA: 100%|██████████| 304/304 [00:00<00:00, 2606.04it/s]\n2025-01-28 01:47:08.649 | SUCCESS | fp8.lora_loading:unload_loras:564 - LoRAs unloaded in 0.12s\nfree=28996837507072\nDownloading weights\n2025-01-28T01:47:08Z | INFO | [ Initiating ] chunk_size=150M dest=/tmp/tmpkqjpahhz/weights url=https://replicate.delivery/xezq/nENtU0FT0XI8P5x2bRj3qRQQsMbM2kWgct4oGbvB49UjXXCF/trained_model.tar\n2025-01-28T01:47:11Z | INFO | [ Complete ] dest=/tmp/tmpkqjpahhz/weights size=\"215 MB\" total_elapsed=2.556s url=https://replicate.delivery/xezq/nENtU0FT0XI8P5x2bRj3qRQQsMbM2kWgct4oGbvB49UjXXCF/trained_model.tar\nDownloaded weights in 2.58s\n2025-01-28 01:47:11.233 | INFO | fp8.lora_loading:convert_lora_weights:498 - Loading LoRA weights for /src/weights-cache/7a19394bea9acc6e\n2025-01-28 01:47:11.314 | INFO | fp8.lora_loading:convert_lora_weights:519 - LoRA weights loaded\n2025-01-28 01:47:11.315 | DEBUG | fp8.lora_loading:apply_lora_to_model:574 - Extracting keys\n2025-01-28 01:47:11.315 | DEBUG | fp8.lora_loading:apply_lora_to_model:581 - Keys extracted\nApplying LoRA: 0%| | 0/304 [00:00<?, ?it/s]\nApplying LoRA: 92%|█████████▏| 281/304 [00:00<00:00, 2803.59it/s]\nApplying LoRA: 100%|██████████| 304/304 [00:00<00:00, 2752.52it/s]\n2025-01-28 01:47:11.426 | SUCCESS | fp8.lora_loading:load_lora:539 - LoRA applied in 0.19s\nUsing seed: 3892\n0it [00:00, ?it/s]\n1it [00:00, 8.36it/s]\n2it [00:00, 5.86it/s]\n3it [00:00, 5.34it/s]\n4it [00:00, 5.12it/s]\n5it [00:00, 4.99it/s]\n6it [00:01, 4.91it/s]\n7it [00:01, 4.88it/s]\n8it [00:01, 4.85it/s]\n9it [00:01, 4.84it/s]\n10it [00:01, 4.82it/s]\n11it [00:02, 4.81it/s]\n12it [00:02, 4.81it/s]\n13it [00:02, 4.81it/s]\n14it [00:02, 4.82it/s]\n15it [00:03, 4.81it/s]\n16it [00:03, 4.81it/s]\n17it [00:03, 4.80it/s]\n18it [00:03, 4.80it/s]\n19it [00:03, 4.81it/s]\n20it [00:04, 4.81it/s]\n21it [00:04, 4.80it/s]\n22it [00:04, 4.79it/s]\n23it [00:04, 4.79it/s]\n24it [00:04, 4.79it/s]\n25it [00:05, 4.79it/s]\n26it [00:05, 4.80it/s]\n27it [00:05, 4.79it/s]\n28it [00:05, 4.80it/s]\n28it [00:05, 4.88it/s]\n0it [00:00, ?it/s]\n1it [00:00, 4.85it/s]\n2it [00:00, 4.82it/s]\n3it [00:00, 4.81it/s]\n4it [00:00, 4.80it/s]\n5it [00:01, 4.79it/s]\n6it [00:01, 4.79it/s]\n7it [00:01, 4.78it/s]\n8it [00:01, 4.78it/s]\n9it [00:01, 4.78it/s]\n10it [00:02, 4.78it/s]\n11it [00:02, 4.78it/s]\n12it [00:02, 4.77it/s]\n13it [00:02, 4.77it/s]\n14it [00:02, 4.76it/s]\n15it [00:03, 4.77it/s]\n16it [00:03, 4.77it/s]\n17it [00:03, 4.76it/s]\n18it [00:03, 4.76it/s]\n19it [00:03, 4.76it/s]\n20it [00:04, 4.77it/s]\n21it [00:04, 4.79it/s]\n22it [00:04, 4.78it/s]\n23it [00:04, 4.77it/s]\n24it [00:05, 4.78it/s]\n25it [00:05, 4.77it/s]\n26it [00:05, 4.77it/s]\n27it [00:05, 4.78it/s]\n28it [00:05, 4.79it/s]\n28it [00:05, 4.78it/s]\n0it [00:00, ?it/s]\n1it [00:00, 4.82it/s]\n2it [00:00, 4.79it/s]\n3it [00:00, 4.78it/s]\n4it [00:00, 4.78it/s]\n5it [00:01, 4.79it/s]\n6it [00:01, 4.79it/s]\n7it [00:01, 4.79it/s]\n8it [00:01, 4.79it/s]\n9it [00:01, 4.79it/s]\n10it [00:02, 4.79it/s]\n11it [00:02, 4.79it/s]\n12it [00:02, 4.79it/s]\n13it [00:02, 4.79it/s]\n14it [00:02, 4.80it/s]\n15it [00:03, 4.79it/s]\n16it [00:03, 4.79it/s]\n17it [00:03, 4.78it/s]\n18it [00:03, 4.78it/s]\n19it [00:03, 4.78it/s]\n20it [00:04, 4.78it/s]\n21it [00:04, 4.78it/s]\n22it [00:04, 4.79it/s]\n23it [00:04, 4.79it/s]\n24it [00:05, 4.79it/s]\n25it [00:05, 4.78it/s]\n26it [00:05, 4.78it/s]\n27it [00:05, 4.78it/s]\n28it [00:05, 4.77it/s]\n28it [00:05, 4.79it/s]\n0it [00:00, ?it/s]\n1it [00:00, 4.83it/s]\n2it [00:00, 4.81it/s]\n3it [00:00, 4.81it/s]\n4it [00:00, 4.81it/s]\n5it [00:01, 4.81it/s]\n6it [00:01, 4.79it/s]\n7it [00:01, 4.79it/s]\n8it [00:01, 4.78it/s]\n9it [00:01, 4.79it/s]\n10it [00:02, 4.79it/s]\n11it [00:02, 4.79it/s]\n12it [00:02, 4.79it/s]\n13it [00:02, 4.78it/s]\n14it [00:02, 4.77it/s]\n15it [00:03, 4.77it/s]\n16it [00:03, 4.78it/s]\n17it [00:03, 4.78it/s]\n18it [00:03, 4.78it/s]\n19it [00:03, 4.78it/s]\n20it [00:04, 4.78it/s]\n21it [00:04, 4.78it/s]\n22it [00:04, 4.78it/s]\n23it [00:04, 4.78it/s]\n24it [00:05, 4.78it/s]\n25it [00:05, 4.77it/s]\n26it [00:05, 4.78it/s]\n27it [00:05, 4.79it/s]\n28it [00:05, 4.79it/s]\n28it [00:05, 4.79it/s]\nTotal safe images: 4 out of 4",
"output": [
"https://replicate.delivery/xezq/L8idWx36Or7TCJJl4lpJyYR52DL6F5hansBLhrpkxe7bSvEKA/out-0.webp",
"https://replicate.delivery/xezq/E8kbFzi5n4JADN5UhQAFyhGcAJ2M5jilXPgzJxMrkuyNpXCF/out-1.webp",
"https://replicate.delivery/xezq/lCl11DVVs4JAH1KUOG1Rn0ppx7r7KEyhPldGn3Ftu3ebSvEKA/out-2.webp",
"https://replicate.delivery/xezq/oHMI57Hmzw6hFJjAybf3sSRMtvLfwfCkeLTbkjvU8mIfm0LhC/out-3.webp"
],
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2025-01-28T01:47:07.694Z",
"started_at": "2025-01-28T01:47:08.532793Z",
"completed_at": "2025-01-28T01:47:35.589146Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/kkhk9tt45srm80cmnabv871gec/cancel",
"get": "https://api.replicate.com/v1/predictions/kkhk9tt45srm80cmnabv871gec",
"stream": "https://stream.replicate.com/v1/files/bsvm-pe3nbrvn4voalo65t4dl3pgfd4a26une6mtj5c6kimw6wztf64ga",
"web": "https://replicate.com/p/kkhk9tt45srm80cmnabv871gec"
},
"metrics": {
"predict_time": 27.056352393,
"total_time": 27.895146
}
}


