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";
import fs from "node:fs";
const replicate = new Replicate({
auth: process.env.REPLICATE_API_TOKEN,
});
Run expa-ai/cloudflare-hack using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"expa-ai/cloudflare-hack:70c6e79ba15f2e9ec26c696ad7eb9f5f0ffe2ae32deadfe9e1e7b17333984201",
{
input: {
image: "https://replicate.delivery/pbxt/KtyErKSr4GYg3VUiPO3cEgsjJLxDUIsPORgit8VA2XJMmomV/Image%20%2810%29.jpeg",
width: 1080,
height: 1280,
prompt: "30 year old woman, tousled pixie cut with long side fringe, silver-grey hair, blue-green eyes, delicate features, fair skin with freckles, warm smile, fuzzy light pink sweater, blurred pastel background, natural window lighting, ultra hd portrait photo, carefree feminine style",
refine: "base_image_refiner",
scheduler: "K_EULER",
num_outputs: 1,
refine_steps: 10,
apply_brand_bg: true,
guidance_scale: 7.5,
apply_watermark: false,
negative_prompt: "low quality, jpeg artifacts, blurry ,poorly drawn, ugly, worst quality, face asymmetry, eyes asymmetry, deformed eyes, open mouth, octane render, render, drawing, anime, bad photo, bad photography, worst quality, low quality, blurry, bad teeth, deformed teeth, deformed lips, bad anatomy, bad proportions, deformed iris, deformed pupils, deformed eyes, bad eyes, deformed face, ugly face, bad face, deformed hands, bad hands, fused fingers, morbid, mutilated, mutation, disfigured",
num_inference_steps: 30
}
}
);
// 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 expa-ai/cloudflare-hack using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"expa-ai/cloudflare-hack:70c6e79ba15f2e9ec26c696ad7eb9f5f0ffe2ae32deadfe9e1e7b17333984201",
input={
"image": "https://replicate.delivery/pbxt/KtyErKSr4GYg3VUiPO3cEgsjJLxDUIsPORgit8VA2XJMmomV/Image%20%2810%29.jpeg",
"width": 1080,
"height": 1280,
"prompt": "30 year old woman, tousled pixie cut with long side fringe, silver-grey hair, blue-green eyes, delicate features, fair skin with freckles, warm smile, fuzzy light pink sweater, blurred pastel background, natural window lighting, ultra hd portrait photo, carefree feminine style",
"refine": "base_image_refiner",
"scheduler": "K_EULER",
"num_outputs": 1,
"refine_steps": 10,
"apply_brand_bg": True,
"guidance_scale": 7.5,
"apply_watermark": False,
"negative_prompt": "low quality, jpeg artifacts, blurry ,poorly drawn, ugly, worst quality, face asymmetry, eyes asymmetry, deformed eyes, open mouth, octane render, render, drawing, anime, bad photo, bad photography, worst quality, low quality, blurry, bad teeth, deformed teeth, deformed lips, bad anatomy, bad proportions, deformed iris, deformed pupils, deformed eyes, bad eyes, deformed face, ugly face, bad face, deformed hands, bad hands, fused fingers, morbid, mutilated, mutation, disfigured",
"num_inference_steps": 30
}
)
# 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=<paste-your-token-here>
Find your API token in your account settings.
Run expa-ai/cloudflare-hack 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": "expa-ai/cloudflare-hack:70c6e79ba15f2e9ec26c696ad7eb9f5f0ffe2ae32deadfe9e1e7b17333984201",
"input": {
"image": "https://replicate.delivery/pbxt/KtyErKSr4GYg3VUiPO3cEgsjJLxDUIsPORgit8VA2XJMmomV/Image%20%2810%29.jpeg",
"width": 1080,
"height": 1280,
"prompt": "30 year old woman, tousled pixie cut with long side fringe, silver-grey hair, blue-green eyes, delicate features, fair skin with freckles, warm smile, fuzzy light pink sweater, blurred pastel background, natural window lighting, ultra hd portrait photo, carefree feminine style",
"refine": "base_image_refiner",
"scheduler": "K_EULER",
"num_outputs": 1,
"refine_steps": 10,
"apply_brand_bg": true,
"guidance_scale": 7.5,
"apply_watermark": false,
"negative_prompt": "low quality, jpeg artifacts, blurry ,poorly drawn, ugly, worst quality, face asymmetry, eyes asymmetry, deformed eyes, open mouth, octane render, render, drawing, anime, bad photo, bad photography, worst quality, low quality, blurry, bad teeth, deformed teeth, deformed lips, bad anatomy, bad proportions, deformed iris, deformed pupils, deformed eyes, bad eyes, deformed face, ugly face, bad face, deformed hands, bad hands, fused fingers, morbid, mutilated, mutation, disfigured",
"num_inference_steps": 30
}
}' \
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/expa-ai/cloudflare-hack@sha256:70c6e79ba15f2e9ec26c696ad7eb9f5f0ffe2ae32deadfe9e1e7b17333984201 \
-i 'image="https://replicate.delivery/pbxt/KtyErKSr4GYg3VUiPO3cEgsjJLxDUIsPORgit8VA2XJMmomV/Image%20%2810%29.jpeg"' \
-i 'width=1080' \
-i 'height=1280' \
-i 'prompt="30 year old woman, tousled pixie cut with long side fringe, silver-grey hair, blue-green eyes, delicate features, fair skin with freckles, warm smile, fuzzy light pink sweater, blurred pastel background, natural window lighting, ultra hd portrait photo, carefree feminine style"' \
-i 'refine="base_image_refiner"' \
-i 'scheduler="K_EULER"' \
-i 'num_outputs=1' \
-i 'refine_steps=10' \
-i 'apply_brand_bg=true' \
-i 'guidance_scale=7.5' \
-i 'apply_watermark=false' \
-i 'negative_prompt="low quality, jpeg artifacts, blurry ,poorly drawn, ugly, worst quality, face asymmetry, eyes asymmetry, deformed eyes, open mouth, octane render, render, drawing, anime, bad photo, bad photography, worst quality, low quality, blurry, bad teeth, deformed teeth, deformed lips, bad anatomy, bad proportions, deformed iris, deformed pupils, deformed eyes, bad eyes, deformed face, ugly face, bad face, deformed hands, bad hands, fused fingers, morbid, mutilated, mutation, disfigured"' \
-i 'num_inference_steps=30'
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/expa-ai/cloudflare-hack@sha256:70c6e79ba15f2e9ec26c696ad7eb9f5f0ffe2ae32deadfe9e1e7b17333984201
curl -s -X POST \ -H "Content-Type: application/json" \ -d $'{ "input": { "image": "https://replicate.delivery/pbxt/KtyErKSr4GYg3VUiPO3cEgsjJLxDUIsPORgit8VA2XJMmomV/Image%20%2810%29.jpeg", "width": 1080, "height": 1280, "prompt": "30 year old woman, tousled pixie cut with long side fringe, silver-grey hair, blue-green eyes, delicate features, fair skin with freckles, warm smile, fuzzy light pink sweater, blurred pastel background, natural window lighting, ultra hd portrait photo, carefree feminine style", "refine": "base_image_refiner", "scheduler": "K_EULER", "num_outputs": 1, "refine_steps": 10, "apply_brand_bg": true, "guidance_scale": 7.5, "apply_watermark": false, "negative_prompt": "low quality, jpeg artifacts, blurry ,poorly drawn, ugly, worst quality, face asymmetry, eyes asymmetry, deformed eyes, open mouth, octane render, render, drawing, anime, bad photo, bad photography, worst quality, low quality, blurry, bad teeth, deformed teeth, deformed lips, bad anatomy, bad proportions, deformed iris, deformed pupils, deformed eyes, bad eyes, deformed face, ugly face, bad face, deformed hands, bad hands, fused fingers, morbid, mutilated, mutation, disfigured", "num_inference_steps": 30 } }' \ http://localhost:5000/predictions
To learn more, take a look at the Cog documentation.
Sign in to run this model.
By signing in, you agree to our
terms of service and privacy policy
{
"completed_at": "2024-05-11T18:39:30.262385Z",
"created_at": "2024-05-11T18:39:08.038000Z",
"data_removed": false,
"error": null,
"id": "37tzv5n10srgg0cfd3st2hsqeg",
"input": {
"image": "https://replicate.delivery/pbxt/KtyErKSr4GYg3VUiPO3cEgsjJLxDUIsPORgit8VA2XJMmomV/Image%20%2810%29.jpeg",
"width": 1080,
"height": 1280,
"prompt": "30 year old woman, tousled pixie cut with long side fringe, silver-grey hair, blue-green eyes, delicate features, fair skin with freckles, warm smile, fuzzy light pink sweater, blurred pastel background, natural window lighting, ultra hd portrait photo, carefree feminine style",
"refine": "base_image_refiner",
"scheduler": "K_EULER",
"num_outputs": 1,
"refine_steps": 10,
"apply_brand_bg": true,
"guidance_scale": 7.5,
"apply_watermark": false,
"negative_prompt": "low quality, jpeg artifacts, blurry ,poorly drawn, ugly, worst quality, face asymmetry, eyes asymmetry, deformed eyes, open mouth, octane render, render, drawing, anime, bad photo, bad photography, worst quality, low quality, blurry, bad teeth, deformed teeth, deformed lips, bad anatomy, bad proportions, deformed iris, deformed pupils, deformed eyes, bad eyes, deformed face, ugly face, bad face, deformed hands, bad hands, fused fingers, morbid, mutilated, mutation, disfigured",
"num_inference_steps": 30
},
"logs": "Starting Face Analysis\nFace analysis done in: 0.02s\nFace Found\nUsing seed: 2294554089\nPrompt: 30 year old woman, tousled pixie cut with long side fringe, silver-grey hair, blue-green eyes, delicate features, fair skin with freckles, warm smile, fuzzy light pink sweater, blurred pastel background, natural window lighting, ultra hd portrait photo, carefree feminine style\n 0%| | 0/30 [00:00<?, ?it/s]\n 3%|▎ | 1/30 [00:00<00:09, 3.01it/s]\n 7%|▋ | 2/30 [00:00<00:09, 3.01it/s]\n 10%|█ | 3/30 [00:00<00:08, 3.00it/s]\n 13%|█▎ | 4/30 [00:01<00:08, 3.00it/s]\n 17%|█▋ | 5/30 [00:01<00:08, 3.00it/s]\n 20%|██ | 6/30 [00:02<00:08, 3.00it/s]\n 23%|██▎ | 7/30 [00:02<00:07, 2.99it/s]\n 27%|██▋ | 8/30 [00:02<00:07, 2.99it/s]\n 30%|███ | 9/30 [00:03<00:07, 2.99it/s]\n 33%|███▎ | 10/30 [00:03<00:06, 2.99it/s]\n 37%|███▋ | 11/30 [00:03<00:06, 2.99it/s]\n 40%|████ | 12/30 [00:04<00:06, 2.98it/s]\n 43%|████▎ | 13/30 [00:04<00:05, 2.98it/s]\n 47%|████▋ | 14/30 [00:04<00:05, 2.98it/s]\n 50%|█████ | 15/30 [00:05<00:05, 2.98it/s]\n 53%|█████▎ | 16/30 [00:05<00:04, 2.98it/s]\n 57%|█████▋ | 17/30 [00:05<00:04, 2.98it/s]\n 60%|██████ | 18/30 [00:06<00:04, 2.98it/s]\n 63%|██████▎ | 19/30 [00:06<00:03, 2.98it/s]\n 67%|██████▋ | 20/30 [00:06<00:03, 2.98it/s]\n 70%|███████ | 21/30 [00:07<00:03, 2.98it/s]\n 73%|███████▎ | 22/30 [00:07<00:02, 2.98it/s]\n 77%|███████▋ | 23/30 [00:07<00:02, 2.98it/s]\n 80%|████████ | 24/30 [00:08<00:02, 2.98it/s]\n 83%|████████▎ | 25/30 [00:08<00:01, 2.98it/s]\n 87%|████████▋ | 26/30 [00:08<00:01, 2.97it/s]\n 90%|█████████ | 27/30 [00:09<00:01, 2.97it/s]\n 93%|█████████▎| 28/30 [00:09<00:00, 2.98it/s]\n 97%|█████████▋| 29/30 [00:09<00:00, 2.98it/s]\n100%|██████████| 30/30 [00:10<00:00, 2.98it/s]\n100%|██████████| 30/30 [00:10<00:00, 2.98it/s]\nInference took: 10.12s\n 0%| | 0/3 [00:00<?, ?it/s]\n 33%|███▎ | 1/3 [00:00<00:00, 2.83it/s]\n 67%|██████▋ | 2/3 [00:00<00:00, 2.82it/s]\n100%|██████████| 3/3 [00:01<00:00, 2.81it/s]\n100%|██████████| 3/3 [00:01<00:00, 2.82it/s]\nFaceswap process Start\nSwapped faces in: 0.15s\nRestored faces in: 3.47s\nBrand background process Start\nImage composition took: 0.06s\nBrand background process took total: 4.94s\nPrediction took: 20.25s",
"metrics": {
"predict_time": 22.178313,
"total_time": 22.224385
},
"output": [
"https://replicate.delivery/pbxt/TPAqXf69cayEekdR95oiLUKBGPaE8nmvj4Fmv0Nn8VUh1WzSA/out-0.jpeg"
],
"started_at": "2024-05-11T18:39:08.084072Z",
"status": "succeeded",
"urls": {
"get": "https://api.replicate.com/v1/predictions/37tzv5n10srgg0cfd3st2hsqeg",
"cancel": "https://api.replicate.com/v1/predictions/37tzv5n10srgg0cfd3st2hsqeg/cancel"
},
"version": "267b672993a9e5b58802f20172ee77fb309cd539425c7ff1b6a2378e60ebe626"
}
Starting Face Analysis
Face analysis done in: 0.02s
Face Found
Using seed: 2294554089
Prompt: 30 year old woman, tousled pixie cut with long side fringe, silver-grey hair, blue-green eyes, delicate features, fair skin with freckles, warm smile, fuzzy light pink sweater, blurred pastel background, natural window lighting, ultra hd portrait photo, carefree feminine style
0%| | 0/30 [00:00<?, ?it/s]
3%|▎ | 1/30 [00:00<00:09, 3.01it/s]
7%|▋ | 2/30 [00:00<00:09, 3.01it/s]
10%|█ | 3/30 [00:00<00:08, 3.00it/s]
13%|█▎ | 4/30 [00:01<00:08, 3.00it/s]
17%|█▋ | 5/30 [00:01<00:08, 3.00it/s]
20%|██ | 6/30 [00:02<00:08, 3.00it/s]
23%|██▎ | 7/30 [00:02<00:07, 2.99it/s]
27%|██▋ | 8/30 [00:02<00:07, 2.99it/s]
30%|███ | 9/30 [00:03<00:07, 2.99it/s]
33%|███▎ | 10/30 [00:03<00:06, 2.99it/s]
37%|███▋ | 11/30 [00:03<00:06, 2.99it/s]
40%|████ | 12/30 [00:04<00:06, 2.98it/s]
43%|████▎ | 13/30 [00:04<00:05, 2.98it/s]
47%|████▋ | 14/30 [00:04<00:05, 2.98it/s]
50%|█████ | 15/30 [00:05<00:05, 2.98it/s]
53%|█████▎ | 16/30 [00:05<00:04, 2.98it/s]
57%|█████▋ | 17/30 [00:05<00:04, 2.98it/s]
60%|██████ | 18/30 [00:06<00:04, 2.98it/s]
63%|██████▎ | 19/30 [00:06<00:03, 2.98it/s]
67%|██████▋ | 20/30 [00:06<00:03, 2.98it/s]
70%|███████ | 21/30 [00:07<00:03, 2.98it/s]
73%|███████▎ | 22/30 [00:07<00:02, 2.98it/s]
77%|███████▋ | 23/30 [00:07<00:02, 2.98it/s]
80%|████████ | 24/30 [00:08<00:02, 2.98it/s]
83%|████████▎ | 25/30 [00:08<00:01, 2.98it/s]
87%|████████▋ | 26/30 [00:08<00:01, 2.97it/s]
90%|█████████ | 27/30 [00:09<00:01, 2.97it/s]
93%|█████████▎| 28/30 [00:09<00:00, 2.98it/s]
97%|█████████▋| 29/30 [00:09<00:00, 2.98it/s]
100%|██████████| 30/30 [00:10<00:00, 2.98it/s]
100%|██████████| 30/30 [00:10<00:00, 2.98it/s]
Inference took: 10.12s
0%| | 0/3 [00:00<?, ?it/s]
33%|███▎ | 1/3 [00:00<00:00, 2.83it/s]
67%|██████▋ | 2/3 [00:00<00:00, 2.82it/s]
100%|██████████| 3/3 [00:01<00:00, 2.81it/s]
100%|██████████| 3/3 [00:01<00:00, 2.82it/s]
Faceswap process Start
Swapped faces in: 0.15s
Restored faces in: 3.47s
Brand background process Start
Image composition took: 0.06s
Brand background process took total: 4.94s
Prediction took: 20.25s
This output was created using a different version of the model, expa-ai/cloudflare-hack:267b6729.
This model runs on Nvidia A100 (80GB) 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 runs on A100 (80GB) hardware which costs $0.0014 per second
Choose a file from your machine
Hint: you can also drag files onto the input
Starting Face Analysis
Face analysis done in: 0.02s
Face Found
Using seed: 2294554089
Prompt: 30 year old woman, tousled pixie cut with long side fringe, silver-grey hair, blue-green eyes, delicate features, fair skin with freckles, warm smile, fuzzy light pink sweater, blurred pastel background, natural window lighting, ultra hd portrait photo, carefree feminine style
0%| | 0/30 [00:00<?, ?it/s]
3%|▎ | 1/30 [00:00<00:09, 3.01it/s]
7%|▋ | 2/30 [00:00<00:09, 3.01it/s]
10%|█ | 3/30 [00:00<00:08, 3.00it/s]
13%|█▎ | 4/30 [00:01<00:08, 3.00it/s]
17%|█▋ | 5/30 [00:01<00:08, 3.00it/s]
20%|██ | 6/30 [00:02<00:08, 3.00it/s]
23%|██▎ | 7/30 [00:02<00:07, 2.99it/s]
27%|██▋ | 8/30 [00:02<00:07, 2.99it/s]
30%|███ | 9/30 [00:03<00:07, 2.99it/s]
33%|███▎ | 10/30 [00:03<00:06, 2.99it/s]
37%|███▋ | 11/30 [00:03<00:06, 2.99it/s]
40%|████ | 12/30 [00:04<00:06, 2.98it/s]
43%|████▎ | 13/30 [00:04<00:05, 2.98it/s]
47%|████▋ | 14/30 [00:04<00:05, 2.98it/s]
50%|█████ | 15/30 [00:05<00:05, 2.98it/s]
53%|█████▎ | 16/30 [00:05<00:04, 2.98it/s]
57%|█████▋ | 17/30 [00:05<00:04, 2.98it/s]
60%|██████ | 18/30 [00:06<00:04, 2.98it/s]
63%|██████▎ | 19/30 [00:06<00:03, 2.98it/s]
67%|██████▋ | 20/30 [00:06<00:03, 2.98it/s]
70%|███████ | 21/30 [00:07<00:03, 2.98it/s]
73%|███████▎ | 22/30 [00:07<00:02, 2.98it/s]
77%|███████▋ | 23/30 [00:07<00:02, 2.98it/s]
80%|████████ | 24/30 [00:08<00:02, 2.98it/s]
83%|████████▎ | 25/30 [00:08<00:01, 2.98it/s]
87%|████████▋ | 26/30 [00:08<00:01, 2.97it/s]
90%|█████████ | 27/30 [00:09<00:01, 2.97it/s]
93%|█████████▎| 28/30 [00:09<00:00, 2.98it/s]
97%|█████████▋| 29/30 [00:09<00:00, 2.98it/s]
100%|██████████| 30/30 [00:10<00:00, 2.98it/s]
100%|██████████| 30/30 [00:10<00:00, 2.98it/s]
Inference took: 10.12s
0%| | 0/3 [00:00<?, ?it/s]
33%|███▎ | 1/3 [00:00<00:00, 2.83it/s]
67%|██████▋ | 2/3 [00:00<00:00, 2.82it/s]
100%|██████████| 3/3 [00:01<00:00, 2.81it/s]
100%|██████████| 3/3 [00:01<00:00, 2.82it/s]
Faceswap process Start
Swapped faces in: 0.15s
Restored faces in: 3.47s
Brand background process Start
Image composition took: 0.06s
Brand background process took total: 4.94s
Prediction took: 20.25s