typetext
{
"aspect_ratio": "1:1",
"extra_lora_scale": 1,
"go_fast": false,
"guidance_scale": 3.75,
"lora_scale": 1,
"megapixels": "1",
"model": "dev",
"num_inference_steps": 30,
"num_outputs": 1,
"output_format": "webp",
"output_quality": 80,
"prompt": "two people jumping on a trampoline in outerspace in the style of TWEAKS",
"prompt_strength": 0.87
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_R7z**********************************
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 colinmcdonnell22/tweak_characters using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"colinmcdonnell22/tweak_characters:3ca068adf5dff6c89e5f61b86d5ba1789c898370e5e97d70e9f66e3443ba8ac7",
{
input: {
aspect_ratio: "1:1",
extra_lora_scale: 1,
go_fast: false,
guidance_scale: 3.75,
lora_scale: 1,
megapixels: "1",
model: "dev",
num_inference_steps: 30,
num_outputs: 1,
output_format: "webp",
output_quality: 80,
prompt: "two people jumping on a trampoline in outerspace in the style of TWEAKS",
prompt_strength: 0.87
}
}
);
// 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_R7z**********************************
This is your API token. Keep it to yourself.
import replicate
Run colinmcdonnell22/tweak_characters using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"colinmcdonnell22/tweak_characters:3ca068adf5dff6c89e5f61b86d5ba1789c898370e5e97d70e9f66e3443ba8ac7",
input={
"aspect_ratio": "1:1",
"extra_lora_scale": 1,
"go_fast": False,
"guidance_scale": 3.75,
"lora_scale": 1,
"megapixels": "1",
"model": "dev",
"num_inference_steps": 30,
"num_outputs": 1,
"output_format": "webp",
"output_quality": 80,
"prompt": "two people jumping on a trampoline in outerspace in the style of TWEAKS",
"prompt_strength": 0.87
}
)
# 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_R7z**********************************
This is your API token. Keep it to yourself.
Run colinmcdonnell22/tweak_characters 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": "colinmcdonnell22/tweak_characters:3ca068adf5dff6c89e5f61b86d5ba1789c898370e5e97d70e9f66e3443ba8ac7",
"input": {
"aspect_ratio": "1:1",
"extra_lora_scale": 1,
"go_fast": false,
"guidance_scale": 3.75,
"lora_scale": 1,
"megapixels": "1",
"model": "dev",
"num_inference_steps": 30,
"num_outputs": 1,
"output_format": "webp",
"output_quality": 80,
"prompt": "two people jumping on a trampoline in outerspace in the style of TWEAKS",
"prompt_strength": 0.87
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "e55ewa5bqsrmc0cke9hrbf1kjr",
"model": "colinmcdonnell22/tweak_characters",
"version": "3ca068adf5dff6c89e5f61b86d5ba1789c898370e5e97d70e9f66e3443ba8ac7",
"input": {
"aspect_ratio": "1:1",
"extra_lora_scale": 1,
"go_fast": false,
"guidance_scale": 3.75,
"lora_scale": 1,
"megapixels": "1",
"model": "dev",
"num_inference_steps": 30,
"num_outputs": 1,
"output_format": "webp",
"output_quality": 80,
"prompt": "two people jumping on a trampoline in outerspace in the style of TWEAKS",
"prompt_strength": 0.87
},
"logs": "2024-11-28 10:49:14.959 | DEBUG | fp8.lora_loading:apply_lora_to_model:569 - Extracting keys\n2024-11-28 10:49:14.960 | DEBUG | fp8.lora_loading:apply_lora_to_model:576 - Keys extracted\nApplying LoRA: 0%| | 0/304 [00:00<?, ?it/s]\nApplying LoRA: 91%|█████████▏| 278/304 [00:00<00:00, 2777.08it/s]\nApplying LoRA: 100%|██████████| 304/304 [00:00<00:00, 2646.20it/s]\n2024-11-28 10:49:15.075 | SUCCESS | fp8.lora_loading:unload_loras:559 - LoRAs unloaded in 0.12s\nfree=29045222453248\nDownloading weights\n2024-11-28T10:49:15Z | INFO | [ Initiating ] chunk_size=150M dest=/tmp/tmp4fs9ju5c/weights url=https://replicate.delivery/xezq/wEmKzwura0LqDFO1gNZfpfYWKAIwRXxfRSDAqDPmeIrK5ereE/trained_model.tar\n2024-11-28T10:49:17Z | INFO | [ Complete ] dest=/tmp/tmp4fs9ju5c/weights size=\"172 MB\" total_elapsed=2.679s url=https://replicate.delivery/xezq/wEmKzwura0LqDFO1gNZfpfYWKAIwRXxfRSDAqDPmeIrK5ereE/trained_model.tar\nDownloaded weights in 2.70s\n2024-11-28 10:49:17.779 | INFO | fp8.lora_loading:convert_lora_weights:493 - Loading LoRA weights for /src/weights-cache/d20bd97f391c84ef\n2024-11-28 10:49:17.849 | INFO | fp8.lora_loading:convert_lora_weights:514 - LoRA weights loaded\n2024-11-28 10:49:17.849 | DEBUG | fp8.lora_loading:apply_lora_to_model:569 - Extracting keys\n2024-11-28 10:49:17.849 | DEBUG | fp8.lora_loading:apply_lora_to_model:576 - Keys extracted\nApplying LoRA: 0%| | 0/304 [00:00<?, ?it/s]\nApplying LoRA: 92%|█████████▏| 279/304 [00:00<00:00, 2775.33it/s]\nApplying LoRA: 100%|██████████| 304/304 [00:00<00:00, 2650.63it/s]\n2024-11-28 10:49:17.964 | SUCCESS | fp8.lora_loading:load_lora:534 - LoRA applied in 0.19s\nUsing seed: 20517\n0it [00:00, ?it/s]\n1it [00:00, 8.33it/s]\n2it [00:00, 5.82it/s]\n3it [00:00, 5.30it/s]\n4it [00:00, 5.09it/s]\n5it [00:00, 4.96it/s]\n6it [00:01, 4.89it/s]\n7it [00:01, 4.84it/s]\n8it [00:01, 4.82it/s]\n9it [00:01, 4.81it/s]\n10it [00:02, 4.78it/s]\n11it [00:02, 4.76it/s]\n12it [00:02, 4.77it/s]\n13it [00:02, 4.77it/s]\n14it [00:02, 4.77it/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.76it/s]\n21it [00:04, 4.75it/s]\n22it [00:04, 4.75it/s]\n23it [00:04, 4.76it/s]\n24it [00:04, 4.76it/s]\n25it [00:05, 4.76it/s]\n26it [00:05, 4.75it/s]\n27it [00:05, 4.75it/s]\n28it [00:05, 4.74it/s]\n29it [00:06, 4.74it/s]\n30it [00:06, 4.75it/s]\n30it [00:06, 4.83it/s]\nTotal safe images: 1 out of 1",
"output": [
"https://replicate.delivery/xezq/qL6EHMpNZLbYINH7gVz7bVUcipFC4O5Gf0FPHy5AZQaa5v6JA/out-0.webp"
],
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2024-11-28T10:49:14.942Z",
"started_at": "2024-11-28T10:49:14.960389Z",
"completed_at": "2024-11-28T10:49:24.543003Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/e55ewa5bqsrmc0cke9hrbf1kjr/cancel",
"get": "https://api.replicate.com/v1/predictions/e55ewa5bqsrmc0cke9hrbf1kjr",
"stream": "https://stream.replicate.com/v1/files/bcwr-uc3milzw6lquphhtvy4srmljp7mf7mbsk34cy4z5z5ka5nizb7yq",
"web": "https://replicate.com/p/e55ewa5bqsrmc0cke9hrbf1kjr"
},
"metrics": {
"predict_time": 9.582613832,
"total_time": 9.601003
}
}