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 ali-vilab/anydoor using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"ali-vilab/anydoor:542c963129c4661ab53a875b1b9a84b2102ca784cf872ef2752a468721c0eb2a",
{
input: {
steps: 50,
bg_mask_path: "https://replicate.delivery/pbxt/KAr3ayPx9LV5sJ66yNbNE6Ge1fg3KE8B7RU999MoMywBMsef/woman-mask.png",
bg_image_path: "https://replicate.delivery/pbxt/KAr3aFKWbmoWfqIZGqxNnMCtCh6LSqS4BnmsDx1sRrgmOI3N/woman.jpg",
guidance_scale: 4.5,
control_strength: 1,
enable_shape_control: false,
reference_image_mask: "https://replicate.delivery/pbxt/KAr3avL7HCXeu0o4QxZyxg7qNXUsjxwoZqKKIBIuyvs6CyeF/blue-polo-mask.png",
reference_image_path: "https://replicate.delivery/pbxt/KAr3b5G84hHCXnwJNPOybjHP7oNUlXYOJUTUkBQVxc3D52zo/blue-polo.jpg"
}
}
);
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 ali-vilab/anydoor using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"ali-vilab/anydoor:542c963129c4661ab53a875b1b9a84b2102ca784cf872ef2752a468721c0eb2a",
input={
"steps": 50,
"bg_mask_path": "https://replicate.delivery/pbxt/KAr3ayPx9LV5sJ66yNbNE6Ge1fg3KE8B7RU999MoMywBMsef/woman-mask.png",
"bg_image_path": "https://replicate.delivery/pbxt/KAr3aFKWbmoWfqIZGqxNnMCtCh6LSqS4BnmsDx1sRrgmOI3N/woman.jpg",
"guidance_scale": 4.5,
"control_strength": 1,
"enable_shape_control": False,
"reference_image_mask": "https://replicate.delivery/pbxt/KAr3avL7HCXeu0o4QxZyxg7qNXUsjxwoZqKKIBIuyvs6CyeF/blue-polo-mask.png",
"reference_image_path": "https://replicate.delivery/pbxt/KAr3b5G84hHCXnwJNPOybjHP7oNUlXYOJUTUkBQVxc3D52zo/blue-polo.jpg"
}
)
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 ali-vilab/anydoor 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": "542c963129c4661ab53a875b1b9a84b2102ca784cf872ef2752a468721c0eb2a",
"input": {
"steps": 50,
"bg_mask_path": "https://replicate.delivery/pbxt/KAr3ayPx9LV5sJ66yNbNE6Ge1fg3KE8B7RU999MoMywBMsef/woman-mask.png",
"bg_image_path": "https://replicate.delivery/pbxt/KAr3aFKWbmoWfqIZGqxNnMCtCh6LSqS4BnmsDx1sRrgmOI3N/woman.jpg",
"guidance_scale": 4.5,
"control_strength": 1,
"enable_shape_control": false,
"reference_image_mask": "https://replicate.delivery/pbxt/KAr3avL7HCXeu0o4QxZyxg7qNXUsjxwoZqKKIBIuyvs6CyeF/blue-polo-mask.png",
"reference_image_path": "https://replicate.delivery/pbxt/KAr3b5G84hHCXnwJNPOybjHP7oNUlXYOJUTUkBQVxc3D52zo/blue-polo.jpg"
}
}' \
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/ali-vilab/anydoor@sha256:542c963129c4661ab53a875b1b9a84b2102ca784cf872ef2752a468721c0eb2a \
-i 'steps=50' \
-i 'bg_mask_path="https://replicate.delivery/pbxt/KAr3ayPx9LV5sJ66yNbNE6Ge1fg3KE8B7RU999MoMywBMsef/woman-mask.png"' \
-i 'bg_image_path="https://replicate.delivery/pbxt/KAr3aFKWbmoWfqIZGqxNnMCtCh6LSqS4BnmsDx1sRrgmOI3N/woman.jpg"' \
-i 'guidance_scale=4.5' \
-i 'control_strength=1' \
-i 'enable_shape_control=false' \
-i 'reference_image_mask="https://replicate.delivery/pbxt/KAr3avL7HCXeu0o4QxZyxg7qNXUsjxwoZqKKIBIuyvs6CyeF/blue-polo-mask.png"' \
-i 'reference_image_path="https://replicate.delivery/pbxt/KAr3b5G84hHCXnwJNPOybjHP7oNUlXYOJUTUkBQVxc3D52zo/blue-polo.jpg"'
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/ali-vilab/anydoor@sha256:542c963129c4661ab53a875b1b9a84b2102ca784cf872ef2752a468721c0eb2a
curl -s -X POST \ -H "Content-Type: application/json" \ -d $'{ "input": { "steps": 50, "bg_mask_path": "https://replicate.delivery/pbxt/KAr3ayPx9LV5sJ66yNbNE6Ge1fg3KE8B7RU999MoMywBMsef/woman-mask.png", "bg_image_path": "https://replicate.delivery/pbxt/KAr3aFKWbmoWfqIZGqxNnMCtCh6LSqS4BnmsDx1sRrgmOI3N/woman.jpg", "guidance_scale": 4.5, "control_strength": 1, "enable_shape_control": false, "reference_image_mask": "https://replicate.delivery/pbxt/KAr3avL7HCXeu0o4QxZyxg7qNXUsjxwoZqKKIBIuyvs6CyeF/blue-polo-mask.png", "reference_image_path": "https://replicate.delivery/pbxt/KAr3b5G84hHCXnwJNPOybjHP7oNUlXYOJUTUkBQVxc3D52zo/blue-polo.jpg" } }' \ 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.0067. 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-01-05T16:13:06.110758Z",
"created_at": "2024-01-05T16:11:31.836609Z",
"data_removed": false,
"error": null,
"id": "kwb7f4tbbsbyuqo6vym44bewq4",
"input": {
"steps": 50,
"bg_mask_path": "https://replicate.delivery/pbxt/KAr3ayPx9LV5sJ66yNbNE6Ge1fg3KE8B7RU999MoMywBMsef/woman-mask.png",
"bg_image_path": "https://replicate.delivery/pbxt/KAr3aFKWbmoWfqIZGqxNnMCtCh6LSqS4BnmsDx1sRrgmOI3N/woman.jpg",
"guidance_scale": 4.5,
"control_strength": 1,
"enable_shape_control": false,
"reference_image_mask": "https://replicate.delivery/pbxt/KAr3avL7HCXeu0o4QxZyxg7qNXUsjxwoZqKKIBIuyvs6CyeF/blue-polo-mask.png",
"reference_image_path": "https://replicate.delivery/pbxt/KAr3b5G84hHCXnwJNPOybjHP7oNUlXYOJUTUkBQVxc3D52zo/blue-polo.jpg"
},
"logs": "Using seed: 562681476\n/root/.pyenv/versions/3.8.5/lib/python3.8/site-packages/xformers/ops/unbind.py:46: UserWarning: TypedStorage is deprecated. It will be removed in the future and UntypedStorage will be the only storage class. This should only matter to you if you are using storages directly. To access UntypedStorage directly, use tensor.untyped_storage() instead of tensor.storage()\nstorage_data_ptr = tensors[0].storage().data_ptr()\n/root/.pyenv/versions/3.8.5/lib/python3.8/site-packages/xformers/ops/unbind.py:48: UserWarning: TypedStorage is deprecated. It will be removed in the future and UntypedStorage will be the only storage class. This should only matter to you if you are using storages directly. To access UntypedStorage directly, use tensor.untyped_storage() instead of tensor.storage()\nif x.storage().data_ptr() != storage_data_ptr:\nData shape for DDIM sampling is (1, 4, 64, 64), eta 0.0\nRunning DDIM Sampling with 50 timesteps\nDDIM Sampler: 0%| | 0/50 [00:00<?, ?it/s]\nDDIM Sampler: 2%|▏ | 1/50 [00:00<00:10, 4.55it/s]\nDDIM Sampler: 4%|▍ | 2/50 [00:00<00:08, 5.45it/s]\nDDIM Sampler: 6%|▌ | 3/50 [00:00<00:08, 5.82it/s]\nDDIM Sampler: 8%|▊ | 4/50 [00:00<00:07, 6.01it/s]\nDDIM Sampler: 10%|█ | 5/50 [00:00<00:07, 6.13it/s]\nDDIM Sampler: 12%|█▏ | 6/50 [00:01<00:07, 6.19it/s]\nDDIM Sampler: 14%|█▍ | 7/50 [00:01<00:06, 6.23it/s]\nDDIM Sampler: 16%|█▌ | 8/50 [00:01<00:06, 6.25it/s]\nDDIM Sampler: 18%|█▊ | 9/50 [00:01<00:06, 6.25it/s]\nDDIM Sampler: 20%|██ | 10/50 [00:01<00:06, 6.27it/s]\nDDIM Sampler: 22%|██▏ | 11/50 [00:01<00:06, 6.27it/s]\nDDIM Sampler: 24%|██▍ | 12/50 [00:01<00:06, 6.28it/s]\nDDIM Sampler: 26%|██▌ | 13/50 [00:02<00:05, 6.28it/s]\nDDIM Sampler: 28%|██▊ | 14/50 [00:02<00:05, 6.29it/s]\nDDIM Sampler: 30%|███ | 15/50 [00:02<00:05, 6.29it/s]\nDDIM Sampler: 32%|███▏ | 16/50 [00:02<00:05, 6.29it/s]\nDDIM Sampler: 34%|███▍ | 17/50 [00:02<00:05, 6.28it/s]\nDDIM Sampler: 36%|███▌ | 18/50 [00:02<00:05, 6.28it/s]\nDDIM Sampler: 38%|███▊ | 19/50 [00:03<00:04, 6.29it/s]\nDDIM Sampler: 40%|████ | 20/50 [00:03<00:04, 6.30it/s]\nDDIM Sampler: 42%|████▏ | 21/50 [00:03<00:04, 6.30it/s]\nDDIM Sampler: 44%|████▍ | 22/50 [00:03<00:04, 6.30it/s]\nDDIM Sampler: 46%|████▌ | 23/50 [00:03<00:04, 6.30it/s]\nDDIM Sampler: 48%|████▊ | 24/50 [00:03<00:04, 6.30it/s]\nDDIM Sampler: 50%|█████ | 25/50 [00:04<00:03, 6.30it/s]\nDDIM Sampler: 52%|█████▏ | 26/50 [00:04<00:03, 6.30it/s]\nDDIM Sampler: 54%|█████▍ | 27/50 [00:04<00:03, 6.30it/s]\nDDIM Sampler: 56%|█████▌ | 28/50 [00:04<00:03, 6.29it/s]\nDDIM Sampler: 58%|█████▊ | 29/50 [00:04<00:03, 6.28it/s]\nDDIM Sampler: 60%|██████ | 30/50 [00:04<00:03, 6.28it/s]\nDDIM Sampler: 62%|██████▏ | 31/50 [00:04<00:03, 6.29it/s]\nDDIM Sampler: 64%|██████▍ | 32/50 [00:05<00:02, 6.30it/s]\nDDIM Sampler: 66%|██████▌ | 33/50 [00:05<00:02, 6.31it/s]\nDDIM Sampler: 68%|██████▊ | 34/50 [00:05<00:02, 6.32it/s]\nDDIM Sampler: 70%|███████ | 35/50 [00:05<00:02, 6.32it/s]\nDDIM Sampler: 72%|███████▏ | 36/50 [00:05<00:02, 6.33it/s]\nDDIM Sampler: 74%|███████▍ | 37/50 [00:05<00:02, 6.33it/s]\nDDIM Sampler: 76%|███████▌ | 38/50 [00:06<00:01, 6.33it/s]\nDDIM Sampler: 78%|███████▊ | 39/50 [00:06<00:01, 6.33it/s]\nDDIM Sampler: 80%|████████ | 40/50 [00:06<00:01, 6.32it/s]\nDDIM Sampler: 82%|████████▏ | 41/50 [00:06<00:01, 6.32it/s]\nDDIM Sampler: 84%|████████▍ | 42/50 [00:06<00:01, 6.32it/s]\nDDIM Sampler: 86%|████████▌ | 43/50 [00:06<00:01, 6.32it/s]\nDDIM Sampler: 88%|████████▊ | 44/50 [00:07<00:00, 6.33it/s]\nDDIM Sampler: 90%|█████████ | 45/50 [00:07<00:00, 6.34it/s]\nDDIM Sampler: 92%|█████████▏| 46/50 [00:07<00:00, 6.35it/s]\nDDIM Sampler: 94%|█████████▍| 47/50 [00:07<00:00, 6.34it/s]\nDDIM Sampler: 96%|█████████▌| 48/50 [00:07<00:00, 6.33it/s]\nDDIM Sampler: 98%|█████████▊| 49/50 [00:07<00:00, 6.33it/s]\nDDIM Sampler: 100%|██████████| 50/50 [00:07<00:00, 6.33it/s]\nDDIM Sampler: 100%|██████████| 50/50 [00:07<00:00, 6.26it/s]",
"metrics": {
"predict_time": 11.687846,
"total_time": 94.274149
},
"output": "https://replicate.delivery/pbxt/jStRPc3ffzieUJFUiqePbecnQuCr87izGYTtaEULnQjMSuLRC/output.png",
"started_at": "2024-01-05T16:12:54.422912Z",
"status": "succeeded",
"urls": {
"get": "https://api.replicate.com/v1/predictions/kwb7f4tbbsbyuqo6vym44bewq4",
"cancel": "https://api.replicate.com/v1/predictions/kwb7f4tbbsbyuqo6vym44bewq4/cancel"
},
"version": "542c963129c4661ab53a875b1b9a84b2102ca784cf872ef2752a468721c0eb2a"
}
Using seed: 562681476
/root/.pyenv/versions/3.8.5/lib/python3.8/site-packages/xformers/ops/unbind.py:46: UserWarning: TypedStorage is deprecated. It will be removed in the future and UntypedStorage will be the only storage class. This should only matter to you if you are using storages directly. To access UntypedStorage directly, use tensor.untyped_storage() instead of tensor.storage()
storage_data_ptr = tensors[0].storage().data_ptr()
/root/.pyenv/versions/3.8.5/lib/python3.8/site-packages/xformers/ops/unbind.py:48: UserWarning: TypedStorage is deprecated. It will be removed in the future and UntypedStorage will be the only storage class. This should only matter to you if you are using storages directly. To access UntypedStorage directly, use tensor.untyped_storage() instead of tensor.storage()
if x.storage().data_ptr() != storage_data_ptr:
Data shape for DDIM sampling is (1, 4, 64, 64), eta 0.0
Running DDIM Sampling with 50 timesteps
DDIM Sampler: 0%| | 0/50 [00:00<?, ?it/s]
DDIM Sampler: 2%|▏ | 1/50 [00:00<00:10, 4.55it/s]
DDIM Sampler: 4%|▍ | 2/50 [00:00<00:08, 5.45it/s]
DDIM Sampler: 6%|▌ | 3/50 [00:00<00:08, 5.82it/s]
DDIM Sampler: 8%|▊ | 4/50 [00:00<00:07, 6.01it/s]
DDIM Sampler: 10%|█ | 5/50 [00:00<00:07, 6.13it/s]
DDIM Sampler: 12%|█▏ | 6/50 [00:01<00:07, 6.19it/s]
DDIM Sampler: 14%|█▍ | 7/50 [00:01<00:06, 6.23it/s]
DDIM Sampler: 16%|█▌ | 8/50 [00:01<00:06, 6.25it/s]
DDIM Sampler: 18%|█▊ | 9/50 [00:01<00:06, 6.25it/s]
DDIM Sampler: 20%|██ | 10/50 [00:01<00:06, 6.27it/s]
DDIM Sampler: 22%|██▏ | 11/50 [00:01<00:06, 6.27it/s]
DDIM Sampler: 24%|██▍ | 12/50 [00:01<00:06, 6.28it/s]
DDIM Sampler: 26%|██▌ | 13/50 [00:02<00:05, 6.28it/s]
DDIM Sampler: 28%|██▊ | 14/50 [00:02<00:05, 6.29it/s]
DDIM Sampler: 30%|███ | 15/50 [00:02<00:05, 6.29it/s]
DDIM Sampler: 32%|███▏ | 16/50 [00:02<00:05, 6.29it/s]
DDIM Sampler: 34%|███▍ | 17/50 [00:02<00:05, 6.28it/s]
DDIM Sampler: 36%|███▌ | 18/50 [00:02<00:05, 6.28it/s]
DDIM Sampler: 38%|███▊ | 19/50 [00:03<00:04, 6.29it/s]
DDIM Sampler: 40%|████ | 20/50 [00:03<00:04, 6.30it/s]
DDIM Sampler: 42%|████▏ | 21/50 [00:03<00:04, 6.30it/s]
DDIM Sampler: 44%|████▍ | 22/50 [00:03<00:04, 6.30it/s]
DDIM Sampler: 46%|████▌ | 23/50 [00:03<00:04, 6.30it/s]
DDIM Sampler: 48%|████▊ | 24/50 [00:03<00:04, 6.30it/s]
DDIM Sampler: 50%|█████ | 25/50 [00:04<00:03, 6.30it/s]
DDIM Sampler: 52%|█████▏ | 26/50 [00:04<00:03, 6.30it/s]
DDIM Sampler: 54%|█████▍ | 27/50 [00:04<00:03, 6.30it/s]
DDIM Sampler: 56%|█████▌ | 28/50 [00:04<00:03, 6.29it/s]
DDIM Sampler: 58%|█████▊ | 29/50 [00:04<00:03, 6.28it/s]
DDIM Sampler: 60%|██████ | 30/50 [00:04<00:03, 6.28it/s]
DDIM Sampler: 62%|██████▏ | 31/50 [00:04<00:03, 6.29it/s]
DDIM Sampler: 64%|██████▍ | 32/50 [00:05<00:02, 6.30it/s]
DDIM Sampler: 66%|██████▌ | 33/50 [00:05<00:02, 6.31it/s]
DDIM Sampler: 68%|██████▊ | 34/50 [00:05<00:02, 6.32it/s]
DDIM Sampler: 70%|███████ | 35/50 [00:05<00:02, 6.32it/s]
DDIM Sampler: 72%|███████▏ | 36/50 [00:05<00:02, 6.33it/s]
DDIM Sampler: 74%|███████▍ | 37/50 [00:05<00:02, 6.33it/s]
DDIM Sampler: 76%|███████▌ | 38/50 [00:06<00:01, 6.33it/s]
DDIM Sampler: 78%|███████▊ | 39/50 [00:06<00:01, 6.33it/s]
DDIM Sampler: 80%|████████ | 40/50 [00:06<00:01, 6.32it/s]
DDIM Sampler: 82%|████████▏ | 41/50 [00:06<00:01, 6.32it/s]
DDIM Sampler: 84%|████████▍ | 42/50 [00:06<00:01, 6.32it/s]
DDIM Sampler: 86%|████████▌ | 43/50 [00:06<00:01, 6.32it/s]
DDIM Sampler: 88%|████████▊ | 44/50 [00:07<00:00, 6.33it/s]
DDIM Sampler: 90%|█████████ | 45/50 [00:07<00:00, 6.34it/s]
DDIM Sampler: 92%|█████████▏| 46/50 [00:07<00:00, 6.35it/s]
DDIM Sampler: 94%|█████████▍| 47/50 [00:07<00:00, 6.34it/s]
DDIM Sampler: 96%|█████████▌| 48/50 [00:07<00:00, 6.33it/s]
DDIM Sampler: 98%|█████████▊| 49/50 [00:07<00:00, 6.33it/s]
DDIM Sampler: 100%|██████████| 50/50 [00:07<00:00, 6.33it/s]
DDIM Sampler: 100%|██████████| 50/50 [00:07<00:00, 6.26it/s]