Readme
This model doesn't have a readme.
Run this model in Node.js with one line of code:
npm install replicate
REPLICATE_API_TOKEN
environment variable:export REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
import Replicate from "replicate";
const replicate = new Replicate({
auth: process.env.REPLICATE_API_TOKEN,
});
Run swk23/thrawn using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"swk23/thrawn:42ae1f4cb37a88cb8bcc17e5949e52290d1fe5a74a50a11b05a61cc98ff62d56",
{
input: {
mask: "https://replicate.delivery/pbxt/MSsWwCc2J9C9y1lJagB7emAf7SUZhq1sm0gox9Bmu87TGfRt/test1.png",
image: "https://replicate.delivery/pbxt/MSsWw1V5lhrBELDWGjE3yj5FMxXWynrP5wluUxurtBu3kpOw/test.png",
model: "dev",
prompt: "\"close up of Grand Admiral Thrawn stands tall in a cold, windowless, metallic Imperial meeting room, His pristine white uniform contrasts against the dark surroundings, his posture exuding quiet confidence and meticulous calculation.\"",
go_fast: false,
lora_scale: 1,
megapixels: "1",
num_outputs: 1,
aspect_ratio: "21:9",
output_format: "jpg",
guidance_scale: 3,
output_quality: 80,
prompt_strength: 0.8,
extra_lora_scale: 1,
num_inference_steps: 28
}
}
);
// 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=<paste-your-token-here>
Find your API token in your account settings.
import replicate
Run swk23/thrawn using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"swk23/thrawn:42ae1f4cb37a88cb8bcc17e5949e52290d1fe5a74a50a11b05a61cc98ff62d56",
input={
"mask": "https://replicate.delivery/pbxt/MSsWwCc2J9C9y1lJagB7emAf7SUZhq1sm0gox9Bmu87TGfRt/test1.png",
"image": "https://replicate.delivery/pbxt/MSsWw1V5lhrBELDWGjE3yj5FMxXWynrP5wluUxurtBu3kpOw/test.png",
"model": "dev",
"prompt": "\"close up of Grand Admiral Thrawn stands tall in a cold, windowless, metallic Imperial meeting room, His pristine white uniform contrasts against the dark surroundings, his posture exuding quiet confidence and meticulous calculation.\"",
"go_fast": False,
"lora_scale": 1,
"megapixels": "1",
"num_outputs": 1,
"aspect_ratio": "21:9",
"output_format": "jpg",
"guidance_scale": 3,
"output_quality": 80,
"prompt_strength": 0.8,
"extra_lora_scale": 1,
"num_inference_steps": 28
}
)
print(output)
To learn more, take a look at the guide on getting started with Python.
REPLICATE_API_TOKEN
environment variable:export REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
Run swk23/thrawn 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": "swk23/thrawn:42ae1f4cb37a88cb8bcc17e5949e52290d1fe5a74a50a11b05a61cc98ff62d56",
"input": {
"mask": "https://replicate.delivery/pbxt/MSsWwCc2J9C9y1lJagB7emAf7SUZhq1sm0gox9Bmu87TGfRt/test1.png",
"image": "https://replicate.delivery/pbxt/MSsWw1V5lhrBELDWGjE3yj5FMxXWynrP5wluUxurtBu3kpOw/test.png",
"model": "dev",
"prompt": "\\"close up of Grand Admiral Thrawn stands tall in a cold, windowless, metallic Imperial meeting room, His pristine white uniform contrasts against the dark surroundings, his posture exuding quiet confidence and meticulous calculation.\\"",
"go_fast": false,
"lora_scale": 1,
"megapixels": "1",
"num_outputs": 1,
"aspect_ratio": "21:9",
"output_format": "jpg",
"guidance_scale": 3,
"output_quality": 80,
"prompt_strength": 0.8,
"extra_lora_scale": 1,
"num_inference_steps": 28
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
brew install cog
If you don’t have Homebrew, there are other installation options available.
Run this to download the model and run it in your local environment:
cog predict r8.im/swk23/thrawn@sha256:42ae1f4cb37a88cb8bcc17e5949e52290d1fe5a74a50a11b05a61cc98ff62d56 \
-i 'mask="https://replicate.delivery/pbxt/MSsWwCc2J9C9y1lJagB7emAf7SUZhq1sm0gox9Bmu87TGfRt/test1.png"' \
-i 'image="https://replicate.delivery/pbxt/MSsWw1V5lhrBELDWGjE3yj5FMxXWynrP5wluUxurtBu3kpOw/test.png"' \
-i 'model="dev"' \
-i $'prompt="\\"close up of Grand Admiral Thrawn stands tall in a cold, windowless, metallic Imperial meeting room, His pristine white uniform contrasts against the dark surroundings, his posture exuding quiet confidence and meticulous calculation.\\""' \
-i 'go_fast=false' \
-i 'lora_scale=1' \
-i 'megapixels="1"' \
-i 'num_outputs=1' \
-i 'aspect_ratio="21:9"' \
-i 'output_format="jpg"' \
-i 'guidance_scale=3' \
-i 'output_quality=80' \
-i 'prompt_strength=0.8' \
-i 'extra_lora_scale=1' \
-i 'num_inference_steps=28'
To learn more, take a look at the Cog documentation.
Run this to download the model and run it in your local environment:
docker run -d -p 5000:5000 --gpus=all r8.im/swk23/thrawn@sha256:42ae1f4cb37a88cb8bcc17e5949e52290d1fe5a74a50a11b05a61cc98ff62d56
curl -s -X POST \ -H "Content-Type: application/json" \ -d $'{ "input": { "mask": "https://replicate.delivery/pbxt/MSsWwCc2J9C9y1lJagB7emAf7SUZhq1sm0gox9Bmu87TGfRt/test1.png", "image": "https://replicate.delivery/pbxt/MSsWw1V5lhrBELDWGjE3yj5FMxXWynrP5wluUxurtBu3kpOw/test.png", "model": "dev", "prompt": "\\"close up of Grand Admiral Thrawn stands tall in a cold, windowless, metallic Imperial meeting room, His pristine white uniform contrasts against the dark surroundings, his posture exuding quiet confidence and meticulous calculation.\\"", "go_fast": false, "lora_scale": 1, "megapixels": "1", "num_outputs": 1, "aspect_ratio": "21:9", "output_format": "jpg", "guidance_scale": 3, "output_quality": 80, "prompt_strength": 0.8, "extra_lora_scale": 1, "num_inference_steps": 28 } }' \ http://localhost:5000/predictions
To learn more, take a look at the Cog documentation.
Add a payment method to run this model.
By signing in, you agree to our
terms of service and privacy policy
{
"completed_at": "2025-02-08T18:58:55.841760Z",
"created_at": "2025-02-08T18:58:49.084000Z",
"data_removed": false,
"error": null,
"id": "bpe83gy2fhrm80cmwvpvnmv1pm",
"input": {
"mask": "https://replicate.delivery/pbxt/MSsWwCc2J9C9y1lJagB7emAf7SUZhq1sm0gox9Bmu87TGfRt/test1.png",
"image": "https://replicate.delivery/pbxt/MSsWw1V5lhrBELDWGjE3yj5FMxXWynrP5wluUxurtBu3kpOw/test.png",
"model": "dev",
"prompt": "\"close up of Grand Admiral Thrawn stands tall in a cold, windowless, metallic Imperial meeting room, His pristine white uniform contrasts against the dark surroundings, his posture exuding quiet confidence and meticulous calculation.\"",
"go_fast": false,
"lora_scale": 1,
"megapixels": "1",
"num_outputs": 1,
"aspect_ratio": "21:9",
"output_format": "jpg",
"guidance_scale": 3,
"output_quality": 80,
"prompt_strength": 0.8,
"extra_lora_scale": 1,
"num_inference_steps": 28
},
"logs": "Loaded LoRAs in 0.56s\nUsing seed: 55506\nPrompt: \"close up of Grand Admiral Thrawn stands tall in a cold, windowless, metallic Imperial meeting room, His pristine white uniform contrasts against the dark surroundings, his posture exuding quiet confidence and meticulous calculation.\"\n[!] Resizing input image from 1536x640 to 1536x640\n[!] inpaint mode\n 0%| | 0/23 [00:00<?, ?it/s]\n 4%|▍ | 1/23 [00:00<00:06, 3.52it/s]\n 9%|▊ | 2/23 [00:00<00:05, 3.92it/s]\n 13%|█▎ | 3/23 [00:00<00:04, 4.06it/s]\n 17%|█▋ | 4/23 [00:00<00:04, 4.14it/s]\n 22%|██▏ | 5/23 [00:01<00:04, 4.18it/s]\n 26%|██▌ | 6/23 [00:01<00:04, 4.21it/s]\n 30%|███ | 7/23 [00:01<00:03, 4.23it/s]\n 35%|███▍ | 8/23 [00:01<00:03, 4.24it/s]\n 39%|███▉ | 9/23 [00:02<00:03, 4.24it/s]\n 43%|████▎ | 10/23 [00:02<00:03, 4.25it/s]\n 48%|████▊ | 11/23 [00:02<00:02, 4.25it/s]\n 52%|█████▏ | 12/23 [00:02<00:02, 4.25it/s]\n 57%|█████▋ | 13/23 [00:03<00:02, 4.26it/s]\n 61%|██████ | 14/23 [00:03<00:02, 4.25it/s]\n 65%|██████▌ | 15/23 [00:03<00:01, 4.25it/s]\n 70%|██████▉ | 16/23 [00:03<00:01, 4.25it/s]\n 74%|███████▍ | 17/23 [00:04<00:01, 4.25it/s]\n 78%|███████▊ | 18/23 [00:04<00:01, 4.25it/s]\n 83%|████████▎ | 19/23 [00:04<00:00, 4.25it/s]\n 87%|████████▋ | 20/23 [00:04<00:00, 4.25it/s]\n 91%|█████████▏| 21/23 [00:04<00:00, 4.26it/s]\n 96%|█████████▌| 22/23 [00:05<00:00, 4.26it/s]\n100%|██████████| 23/23 [00:05<00:00, 4.53it/s]\n100%|██████████| 23/23 [00:05<00:00, 4.25it/s]\nTotal safe images: 1 out of 1",
"metrics": {
"predict_time": 6.669308907,
"total_time": 6.75776
},
"output": [
"https://replicate.delivery/xezq/zMegyYk8Md2bBSftRs0KdEEQrXPRhtzADBDyzv0HS52vtVNUA/out-0.jpg"
],
"started_at": "2025-02-08T18:58:49.172451Z",
"status": "succeeded",
"urls": {
"stream": "https://stream.replicate.com/v1/files/bcwr-36h3s2d3xit33vcetb3jeaijc6vdovgkcsoxyhoiv36bilvr3h3a",
"get": "https://api.replicate.com/v1/predictions/bpe83gy2fhrm80cmwvpvnmv1pm",
"cancel": "https://api.replicate.com/v1/predictions/bpe83gy2fhrm80cmwvpvnmv1pm/cancel"
},
"version": "42ae1f4cb37a88cb8bcc17e5949e52290d1fe5a74a50a11b05a61cc98ff62d56"
}
Loaded LoRAs in 0.56s
Using seed: 55506
Prompt: "close up of Grand Admiral Thrawn stands tall in a cold, windowless, metallic Imperial meeting room, His pristine white uniform contrasts against the dark surroundings, his posture exuding quiet confidence and meticulous calculation."
[!] Resizing input image from 1536x640 to 1536x640
[!] inpaint mode
0%| | 0/23 [00:00<?, ?it/s]
4%|▍ | 1/23 [00:00<00:06, 3.52it/s]
9%|▊ | 2/23 [00:00<00:05, 3.92it/s]
13%|█▎ | 3/23 [00:00<00:04, 4.06it/s]
17%|█▋ | 4/23 [00:00<00:04, 4.14it/s]
22%|██▏ | 5/23 [00:01<00:04, 4.18it/s]
26%|██▌ | 6/23 [00:01<00:04, 4.21it/s]
30%|███ | 7/23 [00:01<00:03, 4.23it/s]
35%|███▍ | 8/23 [00:01<00:03, 4.24it/s]
39%|███▉ | 9/23 [00:02<00:03, 4.24it/s]
43%|████▎ | 10/23 [00:02<00:03, 4.25it/s]
48%|████▊ | 11/23 [00:02<00:02, 4.25it/s]
52%|█████▏ | 12/23 [00:02<00:02, 4.25it/s]
57%|█████▋ | 13/23 [00:03<00:02, 4.26it/s]
61%|██████ | 14/23 [00:03<00:02, 4.25it/s]
65%|██████▌ | 15/23 [00:03<00:01, 4.25it/s]
70%|██████▉ | 16/23 [00:03<00:01, 4.25it/s]
74%|███████▍ | 17/23 [00:04<00:01, 4.25it/s]
78%|███████▊ | 18/23 [00:04<00:01, 4.25it/s]
83%|████████▎ | 19/23 [00:04<00:00, 4.25it/s]
87%|████████▋ | 20/23 [00:04<00:00, 4.25it/s]
91%|█████████▏| 21/23 [00:04<00:00, 4.26it/s]
96%|█████████▌| 22/23 [00:05<00:00, 4.26it/s]
100%|██████████| 23/23 [00:05<00:00, 4.53it/s]
100%|██████████| 23/23 [00:05<00:00, 4.25it/s]
Total safe images: 1 out of 1
This model runs on Nvidia H100 GPU hardware. We don't yet have enough runs of this model to provide performance information.
This model doesn't have a readme.
This model is warm. You'll get a fast response if the model is warm and already running, and a slower response if the model is cold and starting up.
Choose a file from your machine
Hint: you can also drag files onto the input
Choose a file from your machine
Hint: you can also drag files onto the input
Loaded LoRAs in 0.56s
Using seed: 55506
Prompt: "close up of Grand Admiral Thrawn stands tall in a cold, windowless, metallic Imperial meeting room, His pristine white uniform contrasts against the dark surroundings, his posture exuding quiet confidence and meticulous calculation."
[!] Resizing input image from 1536x640 to 1536x640
[!] inpaint mode
0%| | 0/23 [00:00<?, ?it/s]
4%|▍ | 1/23 [00:00<00:06, 3.52it/s]
9%|▊ | 2/23 [00:00<00:05, 3.92it/s]
13%|█▎ | 3/23 [00:00<00:04, 4.06it/s]
17%|█▋ | 4/23 [00:00<00:04, 4.14it/s]
22%|██▏ | 5/23 [00:01<00:04, 4.18it/s]
26%|██▌ | 6/23 [00:01<00:04, 4.21it/s]
30%|███ | 7/23 [00:01<00:03, 4.23it/s]
35%|███▍ | 8/23 [00:01<00:03, 4.24it/s]
39%|███▉ | 9/23 [00:02<00:03, 4.24it/s]
43%|████▎ | 10/23 [00:02<00:03, 4.25it/s]
48%|████▊ | 11/23 [00:02<00:02, 4.25it/s]
52%|█████▏ | 12/23 [00:02<00:02, 4.25it/s]
57%|█████▋ | 13/23 [00:03<00:02, 4.26it/s]
61%|██████ | 14/23 [00:03<00:02, 4.25it/s]
65%|██████▌ | 15/23 [00:03<00:01, 4.25it/s]
70%|██████▉ | 16/23 [00:03<00:01, 4.25it/s]
74%|███████▍ | 17/23 [00:04<00:01, 4.25it/s]
78%|███████▊ | 18/23 [00:04<00:01, 4.25it/s]
83%|████████▎ | 19/23 [00:04<00:00, 4.25it/s]
87%|████████▋ | 20/23 [00:04<00:00, 4.25it/s]
91%|█████████▏| 21/23 [00:04<00:00, 4.26it/s]
96%|█████████▌| 22/23 [00:05<00:00, 4.26it/s]
100%|██████████| 23/23 [00:05<00:00, 4.53it/s]
100%|██████████| 23/23 [00:05<00:00, 4.25it/s]
Total safe images: 1 out of 1