typetext
{
"aspect_ratio": "1:1",
"extra_lora_scale": 1,
"go_fast": false,
"guidance_scale": 0.26,
"lora_scale": 1,
"megapixels": "1",
"model": "schnell",
"num_inference_steps": 4,
"num_outputs": 1,
"output_format": "png",
"output_quality": 80,
"prompt": "TOK",
"prompt_strength": 0
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_NIh**********************************
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 codelace/pixelpunkssmallernocaption2 using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"codelace/pixelpunkssmallernocaption2:56c0c0edc732dd95684f09eba504a54bc5c8dd024e2af3991722cd8021745478",
{
input: {
aspect_ratio: "1:1",
extra_lora_scale: 1,
go_fast: false,
guidance_scale: 0.26,
lora_scale: 1,
megapixels: "1",
model: "schnell",
num_inference_steps: 4,
num_outputs: 1,
output_format: "png",
output_quality: 80,
prompt: "TOK",
prompt_strength: 0
}
}
);
// 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_NIh**********************************
This is your API token. Keep it to yourself.
import replicate
Run codelace/pixelpunkssmallernocaption2 using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"codelace/pixelpunkssmallernocaption2:56c0c0edc732dd95684f09eba504a54bc5c8dd024e2af3991722cd8021745478",
input={
"aspect_ratio": "1:1",
"extra_lora_scale": 1,
"go_fast": False,
"guidance_scale": 0.26,
"lora_scale": 1,
"megapixels": "1",
"model": "schnell",
"num_inference_steps": 4,
"num_outputs": 1,
"output_format": "png",
"output_quality": 80,
"prompt": "TOK",
"prompt_strength": 0
}
)
# 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_NIh**********************************
This is your API token. Keep it to yourself.
Run codelace/pixelpunkssmallernocaption2 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": "codelace/pixelpunkssmallernocaption2:56c0c0edc732dd95684f09eba504a54bc5c8dd024e2af3991722cd8021745478",
"input": {
"aspect_ratio": "1:1",
"extra_lora_scale": 1,
"go_fast": false,
"guidance_scale": 0.26,
"lora_scale": 1,
"megapixels": "1",
"model": "schnell",
"num_inference_steps": 4,
"num_outputs": 1,
"output_format": "png",
"output_quality": 80,
"prompt": "TOK",
"prompt_strength": 0
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "wdnwrd48kdrm80cmeaptjm1x2m",
"model": "codelace/pixelpunkssmallernocaption2",
"version": "56c0c0edc732dd95684f09eba504a54bc5c8dd024e2af3991722cd8021745478",
"input": {
"aspect_ratio": "1:1",
"extra_lora_scale": 1,
"go_fast": false,
"guidance_scale": 0.26,
"lora_scale": 1,
"megapixels": "1",
"model": "schnell",
"num_inference_steps": 4,
"num_outputs": 1,
"output_format": "png",
"output_quality": 80,
"prompt": "TOK",
"prompt_strength": 0
},
"logs": "2025-01-17 05:12:42.940 | DEBUG | fp8.lora_loading:apply_lora_to_model:574 - Extracting keys\n2025-01-17 05:12:42.940 | DEBUG | fp8.lora_loading:apply_lora_to_model:581 - Keys extracted\nApplying LoRA: 0%| | 0/304 [00:00<?, ?it/s]\nApplying LoRA: 91%|█████████ | 277/304 [00:00<00:00, 2765.66it/s]\nApplying LoRA: 100%|██████████| 304/304 [00:00<00:00, 2682.16it/s]\n2025-01-17 05:12:43.054 | SUCCESS | fp8.lora_loading:unload_loras:564 - LoRAs unloaded in 0.11s\n2025-01-17 05:12:43.055 | INFO | fp8.lora_loading:convert_lora_weights:498 - Loading LoRA weights for /src/weights-cache/fb12e597822adb8d\n2025-01-17 05:12:43.199 | INFO | fp8.lora_loading:convert_lora_weights:519 - LoRA weights loaded\n2025-01-17 05:12:43.199 | DEBUG | fp8.lora_loading:apply_lora_to_model:574 - Extracting keys\n2025-01-17 05:12:43.199 | DEBUG | fp8.lora_loading:apply_lora_to_model:581 - Keys extracted\nApplying LoRA: 0%| | 0/304 [00:00<?, ?it/s]\nApplying LoRA: 91%|█████████ | 277/304 [00:00<00:00, 2768.16it/s]\nApplying LoRA: 100%|██████████| 304/304 [00:00<00:00, 2684.51it/s]\n2025-01-17 05:12:43.313 | SUCCESS | fp8.lora_loading:load_lora:539 - LoRA applied in 0.26s\nUsing seed: 60883\n0it [00:00, ?it/s]\n1it [00:00, 8.33it/s]\n2it [00:00, 5.83it/s]\n3it [00:00, 5.32it/s]\n4it [00:00, 5.12it/s]\n4it [00:00, 5.39it/s]\nTotal safe images: 1 out of 1",
"output": [
"https://replicate.delivery/xezq/gbItM8sWxMpLLB3tsfRWp3dQYhyN3TzwCm0DvE0bJuFmx8CKA/out-0.png"
],
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2025-01-17T05:12:42.907Z",
"started_at": "2025-01-17T05:12:42.941036Z",
"completed_at": "2025-01-17T05:12:44.591048Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/wdnwrd48kdrm80cmeaptjm1x2m/cancel",
"get": "https://api.replicate.com/v1/predictions/wdnwrd48kdrm80cmeaptjm1x2m",
"stream": "https://stream.replicate.com/v1/files/bcwr-rhxau4hjqtamvk6haf4g4mhv7hve64uwejjbhiu3acx6ftlxurla",
"web": "https://replicate.com/p/wdnwrd48kdrm80cmeaptjm1x2m"
},
"metrics": {
"predict_time": 1.650012458,
"total_time": 1.684048
}
}