You're looking at a specific version of this model. Jump to the model overview.
Input
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 fofr/illusions using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"fofr/illusions:579b32db82b24584c3c6155fe3ae12e8fce50ba28b575c23e8a1f5f3a5e99ed8",
{
input: {
seed: -1,
image: "https://replicate.delivery/pbxt/JouANiZNiW2mwouIgIk1VySvjL9MBmaPD6Ib8HyfW81CJzRR/out-0-44.png",
width: 768,
height: 768,
prompt: "a painting of a 19th century town",
num_outputs: 1,
control_image: "https://replicate.delivery/pbxt/JouAO2zaHgb66YVChJagSYz0LcGqv3QgG4BS71mioFbBHWTZ/spiral_black_transparent-2513050263.jpg",
controlnet_end: 1,
guidance_scale: 7.5,
negative_prompt: "ugly, disfigured, low quality, blurry, nsfw",
prompt_strength: 0.75,
sizing_strategy: "width/height",
controlnet_start: 0,
num_inference_steps: 40,
controlnet_conditioning_scale: 0.75
}
}
);
console.log(output);
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 fofr/illusions using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"fofr/illusions:579b32db82b24584c3c6155fe3ae12e8fce50ba28b575c23e8a1f5f3a5e99ed8",
input={
"seed": -1,
"image": "https://replicate.delivery/pbxt/JouANiZNiW2mwouIgIk1VySvjL9MBmaPD6Ib8HyfW81CJzRR/out-0-44.png",
"width": 768,
"height": 768,
"prompt": "a painting of a 19th century town",
"num_outputs": 1,
"control_image": "https://replicate.delivery/pbxt/JouAO2zaHgb66YVChJagSYz0LcGqv3QgG4BS71mioFbBHWTZ/spiral_black_transparent-2513050263.jpg",
"controlnet_end": 1,
"guidance_scale": 7.5,
"negative_prompt": "ugly, disfigured, low quality, blurry, nsfw",
"prompt_strength": 0.75,
"sizing_strategy": "width/height",
"controlnet_start": 0,
"num_inference_steps": 40,
"controlnet_conditioning_scale": 0.75
}
)
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 fofr/illusions 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": "579b32db82b24584c3c6155fe3ae12e8fce50ba28b575c23e8a1f5f3a5e99ed8",
"input": {
"seed": -1,
"image": "https://replicate.delivery/pbxt/JouANiZNiW2mwouIgIk1VySvjL9MBmaPD6Ib8HyfW81CJzRR/out-0-44.png",
"width": 768,
"height": 768,
"prompt": "a painting of a 19th century town",
"num_outputs": 1,
"control_image": "https://replicate.delivery/pbxt/JouAO2zaHgb66YVChJagSYz0LcGqv3QgG4BS71mioFbBHWTZ/spiral_black_transparent-2513050263.jpg",
"controlnet_end": 1,
"guidance_scale": 7.5,
"negative_prompt": "ugly, disfigured, low quality, blurry, nsfw",
"prompt_strength": 0.75,
"sizing_strategy": "width/height",
"controlnet_start": 0,
"num_inference_steps": 40,
"controlnet_conditioning_scale": 0.75
}
}' \
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/fofr/illusions@sha256:579b32db82b24584c3c6155fe3ae12e8fce50ba28b575c23e8a1f5f3a5e99ed8 \
-i 'seed=-1' \
-i 'image="https://replicate.delivery/pbxt/JouANiZNiW2mwouIgIk1VySvjL9MBmaPD6Ib8HyfW81CJzRR/out-0-44.png"' \
-i 'width=768' \
-i 'height=768' \
-i 'prompt="a painting of a 19th century town"' \
-i 'num_outputs=1' \
-i 'control_image="https://replicate.delivery/pbxt/JouAO2zaHgb66YVChJagSYz0LcGqv3QgG4BS71mioFbBHWTZ/spiral_black_transparent-2513050263.jpg"' \
-i 'controlnet_end=1' \
-i 'guidance_scale=7.5' \
-i 'negative_prompt="ugly, disfigured, low quality, blurry, nsfw"' \
-i 'prompt_strength=0.75' \
-i 'sizing_strategy="width/height"' \
-i 'controlnet_start=0' \
-i 'num_inference_steps=40' \
-i 'controlnet_conditioning_scale=0.75'
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/fofr/illusions@sha256:579b32db82b24584c3c6155fe3ae12e8fce50ba28b575c23e8a1f5f3a5e99ed8
curl -s -X POST \ -H "Content-Type: application/json" \ -d $'{ "input": { "seed": -1, "image": "https://replicate.delivery/pbxt/JouANiZNiW2mwouIgIk1VySvjL9MBmaPD6Ib8HyfW81CJzRR/out-0-44.png", "width": 768, "height": 768, "prompt": "a painting of a 19th century town", "num_outputs": 1, "control_image": "https://replicate.delivery/pbxt/JouAO2zaHgb66YVChJagSYz0LcGqv3QgG4BS71mioFbBHWTZ/spiral_black_transparent-2513050263.jpg", "controlnet_end": 1, "guidance_scale": 7.5, "negative_prompt": "ugly, disfigured, low quality, blurry, nsfw", "prompt_strength": 0.75, "sizing_strategy": "width/height", "controlnet_start": 0, "num_inference_steps": 40, "controlnet_conditioning_scale": 0.75 } }' \ http://localhost:5000/predictions
To learn more, take a look at the Cog documentation.
Add a payment method to run this model.
Each run costs approximately $0.017. Alternatively, try out our featured models for free.
By signing in, you agree to our
terms of service and privacy policy
Output
{
"completed_at": "2024-11-28T11:32:46.230072Z",
"created_at": "2024-11-28T11:32:43.659000Z",
"data_removed": false,
"error": null,
"id": "tjnxcd3t1drm80ckea5t26p0g4",
"input": {
"seed": -1,
"image": "https://replicate.delivery/pbxt/JouANiZNiW2mwouIgIk1VySvjL9MBmaPD6Ib8HyfW81CJzRR/out-0-44.png",
"width": 768,
"height": 768,
"prompt": "a painting of a 19th century town",
"num_outputs": 1,
"control_image": "https://replicate.delivery/pbxt/JouAO2zaHgb66YVChJagSYz0LcGqv3QgG4BS71mioFbBHWTZ/spiral_black_transparent-2513050263.jpg",
"controlnet_end": 1,
"guidance_scale": 7.5,
"negative_prompt": "ugly, disfigured, low quality, blurry, nsfw",
"prompt_strength": 0.75,
"sizing_strategy": "width/height",
"controlnet_start": 0,
"num_inference_steps": 40,
"controlnet_conditioning_scale": 0.75
},
"logs": "Using seed: 3311311052\nimg2img mode\nUsing given dimensions\n 0%| | 0/30 [00:00<?, ?it/s]\n 3%|▎ | 1/30 [00:00<00:03, 8.15it/s]\n 10%|█ | 3/30 [00:00<00:02, 12.79it/s]\n 17%|█▋ | 5/30 [00:00<00:01, 14.25it/s]\n 23%|██▎ | 7/30 [00:00<00:01, 14.90it/s]\n 30%|███ | 9/30 [00:00<00:01, 15.31it/s]\n 37%|███▋ | 11/30 [00:00<00:01, 15.55it/s]\n 43%|████▎ | 13/30 [00:00<00:01, 15.67it/s]\n 50%|█████ | 15/30 [00:00<00:00, 15.76it/s]\n 57%|█████▋ | 17/30 [00:01<00:00, 15.83it/s]\n 63%|██████▎ | 19/30 [00:01<00:00, 15.86it/s]\n 70%|███████ | 21/30 [00:01<00:00, 15.88it/s]\n 77%|███████▋ | 23/30 [00:01<00:00, 15.89it/s]\n 83%|████████▎ | 25/30 [00:01<00:00, 15.90it/s]\n 90%|█████████ | 27/30 [00:01<00:00, 15.90it/s]\n 97%|█████████▋| 29/30 [00:01<00:00, 15.89it/s]\n100%|██████████| 30/30 [00:01<00:00, 15.45it/s]",
"metrics": {
"predict_time": 2.561864317,
"total_time": 2.571072
},
"output": [
"https://replicate.delivery/xezq/iA3MUV1f533LXqi4sHVlAerJhr03uES9OlBHAHrqaeq92ArnA/output-0.png"
],
"started_at": "2024-11-28T11:32:43.668207Z",
"status": "succeeded",
"urls": {
"stream": "https://stream.replicate.com/v1/files/bcwr-trpj5ikdlb3ons6twy3fo36eqpz4ciq4hgdk7xnfwv5kyvwjdqua",
"get": "https://api.replicate.com/v1/predictions/tjnxcd3t1drm80ckea5t26p0g4",
"cancel": "https://api.replicate.com/v1/predictions/tjnxcd3t1drm80ckea5t26p0g4/cancel"
},
"version": "579b32db82b24584c3c6155fe3ae12e8fce50ba28b575c23e8a1f5f3a5e99ed8"
}
Using seed: 3311311052
img2img mode
Using given dimensions
0%| | 0/30 [00:00<?, ?it/s]
3%|▎ | 1/30 [00:00<00:03, 8.15it/s]
10%|█ | 3/30 [00:00<00:02, 12.79it/s]
17%|█▋ | 5/30 [00:00<00:01, 14.25it/s]
23%|██▎ | 7/30 [00:00<00:01, 14.90it/s]
30%|███ | 9/30 [00:00<00:01, 15.31it/s]
37%|███▋ | 11/30 [00:00<00:01, 15.55it/s]
43%|████▎ | 13/30 [00:00<00:01, 15.67it/s]
50%|█████ | 15/30 [00:00<00:00, 15.76it/s]
57%|█████▋ | 17/30 [00:01<00:00, 15.83it/s]
63%|██████▎ | 19/30 [00:01<00:00, 15.86it/s]
70%|███████ | 21/30 [00:01<00:00, 15.88it/s]
77%|███████▋ | 23/30 [00:01<00:00, 15.89it/s]
83%|████████▎ | 25/30 [00:01<00:00, 15.90it/s]
90%|█████████ | 27/30 [00:01<00:00, 15.90it/s]
97%|█████████▋| 29/30 [00:01<00:00, 15.89it/s]
100%|██████████| 30/30 [00:01<00:00, 15.45it/s]