ali-vilab
/
anydoor
Anydoor: zero-shot object-level image customization
Prediction
ali-vilab/anydoor:542c9631IDkwb7f4tbbsbyuqo6vym44bewq4StatusSucceededSourceWebHardwareA40 (Large)Total durationCreatedInput
- steps
- 50
- guidance_scale
- 4.5
- control_strength
- 1
- enable_shape_control
{ "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" }
Install Replicate’s Node.js client library:npm install replicate
Set theREPLICATE_API_TOKEN
environment variable:export REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
Import and set up the client: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.
Install Replicate’s Python client library:pip install replicate
Set theREPLICATE_API_TOKEN
environment variable:export REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
Import the client: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.
Set theREPLICATE_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.
You can run this model locally using Cog. First, install Cog: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.
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" }
Generated inUsing 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]
Prediction
ali-vilab/anydoor:542c9631IDvtxdxidb4u2u64w7ffou7tdvgyStatusSucceededSourceWebHardwareA40 (Large)Total durationCreatedInput
- steps
- 30
- guidance_scale
- 4.5
- control_strength
- 1
- enable_shape_control
{ "steps": 30, "bg_mask_path": "https://replicate.delivery/pbxt/KAr5sZjqxgOrXGCOo2PAkvrywmnD8s6gtGYEKAzxV1n8UsKN/burger-mask.png", "bg_image_path": "https://replicate.delivery/pbxt/KAr5t2fIFVQ4eNy4JwN6LAZpHyTYzXHaO78TinDeHzYWK9RS/burger.png", "guidance_scale": 4.5, "control_strength": 1, "enable_shape_control": false, "reference_image_mask": "https://replicate.delivery/pbxt/KAr5swy9Bdkv4cM2IKAvLoxCMWtLLmMLFSK1SpwTLDxzdYgW/sloth-mask.png", "reference_image_path": "https://replicate.delivery/pbxt/KAr5sJGlXZyZPR2SfOduHMvnUgS1CIc81ynRVCdHV24JdTo0/sloth.png" }
Install Replicate’s Node.js client library:npm install replicate
Set theREPLICATE_API_TOKEN
environment variable:export REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
Import and set up the client: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: 30, bg_mask_path: "https://replicate.delivery/pbxt/KAr5sZjqxgOrXGCOo2PAkvrywmnD8s6gtGYEKAzxV1n8UsKN/burger-mask.png", bg_image_path: "https://replicate.delivery/pbxt/KAr5t2fIFVQ4eNy4JwN6LAZpHyTYzXHaO78TinDeHzYWK9RS/burger.png", guidance_scale: 4.5, control_strength: 1, enable_shape_control: false, reference_image_mask: "https://replicate.delivery/pbxt/KAr5swy9Bdkv4cM2IKAvLoxCMWtLLmMLFSK1SpwTLDxzdYgW/sloth-mask.png", reference_image_path: "https://replicate.delivery/pbxt/KAr5sJGlXZyZPR2SfOduHMvnUgS1CIc81ynRVCdHV24JdTo0/sloth.png" } } ); console.log(output);
To learn more, take a look at the guide on getting started with Node.js.
Install Replicate’s Python client library:pip install replicate
Set theREPLICATE_API_TOKEN
environment variable:export REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
Import the client: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": 30, "bg_mask_path": "https://replicate.delivery/pbxt/KAr5sZjqxgOrXGCOo2PAkvrywmnD8s6gtGYEKAzxV1n8UsKN/burger-mask.png", "bg_image_path": "https://replicate.delivery/pbxt/KAr5t2fIFVQ4eNy4JwN6LAZpHyTYzXHaO78TinDeHzYWK9RS/burger.png", "guidance_scale": 4.5, "control_strength": 1, "enable_shape_control": False, "reference_image_mask": "https://replicate.delivery/pbxt/KAr5swy9Bdkv4cM2IKAvLoxCMWtLLmMLFSK1SpwTLDxzdYgW/sloth-mask.png", "reference_image_path": "https://replicate.delivery/pbxt/KAr5sJGlXZyZPR2SfOduHMvnUgS1CIc81ynRVCdHV24JdTo0/sloth.png" } ) print(output)
To learn more, take a look at the guide on getting started with Python.
Set theREPLICATE_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": 30, "bg_mask_path": "https://replicate.delivery/pbxt/KAr5sZjqxgOrXGCOo2PAkvrywmnD8s6gtGYEKAzxV1n8UsKN/burger-mask.png", "bg_image_path": "https://replicate.delivery/pbxt/KAr5t2fIFVQ4eNy4JwN6LAZpHyTYzXHaO78TinDeHzYWK9RS/burger.png", "guidance_scale": 4.5, "control_strength": 1, "enable_shape_control": false, "reference_image_mask": "https://replicate.delivery/pbxt/KAr5swy9Bdkv4cM2IKAvLoxCMWtLLmMLFSK1SpwTLDxzdYgW/sloth-mask.png", "reference_image_path": "https://replicate.delivery/pbxt/KAr5sJGlXZyZPR2SfOduHMvnUgS1CIc81ynRVCdHV24JdTo0/sloth.png" } }' \ https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
You can run this model locally using Cog. First, install Cog: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=30' \ -i 'bg_mask_path="https://replicate.delivery/pbxt/KAr5sZjqxgOrXGCOo2PAkvrywmnD8s6gtGYEKAzxV1n8UsKN/burger-mask.png"' \ -i 'bg_image_path="https://replicate.delivery/pbxt/KAr5t2fIFVQ4eNy4JwN6LAZpHyTYzXHaO78TinDeHzYWK9RS/burger.png"' \ -i 'guidance_scale=4.5' \ -i 'control_strength=1' \ -i 'enable_shape_control=false' \ -i 'reference_image_mask="https://replicate.delivery/pbxt/KAr5swy9Bdkv4cM2IKAvLoxCMWtLLmMLFSK1SpwTLDxzdYgW/sloth-mask.png"' \ -i 'reference_image_path="https://replicate.delivery/pbxt/KAr5sJGlXZyZPR2SfOduHMvnUgS1CIc81ynRVCdHV24JdTo0/sloth.png"'
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": 30, "bg_mask_path": "https://replicate.delivery/pbxt/KAr5sZjqxgOrXGCOo2PAkvrywmnD8s6gtGYEKAzxV1n8UsKN/burger-mask.png", "bg_image_path": "https://replicate.delivery/pbxt/KAr5t2fIFVQ4eNy4JwN6LAZpHyTYzXHaO78TinDeHzYWK9RS/burger.png", "guidance_scale": 4.5, "control_strength": 1, "enable_shape_control": false, "reference_image_mask": "https://replicate.delivery/pbxt/KAr5swy9Bdkv4cM2IKAvLoxCMWtLLmMLFSK1SpwTLDxzdYgW/sloth-mask.png", "reference_image_path": "https://replicate.delivery/pbxt/KAr5sJGlXZyZPR2SfOduHMvnUgS1CIc81ynRVCdHV24JdTo0/sloth.png" } }' \ http://localhost:5000/predictions
To learn more, take a look at the Cog documentation.
Output
{ "completed_at": "2024-01-05T16:14:05.078761Z", "created_at": "2024-01-05T16:13:57.255429Z", "data_removed": false, "error": null, "id": "vtxdxidb4u2u64w7ffou7tdvgy", "input": { "steps": 30, "bg_mask_path": "https://replicate.delivery/pbxt/KAr5sZjqxgOrXGCOo2PAkvrywmnD8s6gtGYEKAzxV1n8UsKN/burger-mask.png", "bg_image_path": "https://replicate.delivery/pbxt/KAr5t2fIFVQ4eNy4JwN6LAZpHyTYzXHaO78TinDeHzYWK9RS/burger.png", "guidance_scale": 4.5, "control_strength": 1, "enable_shape_control": false, "reference_image_mask": "https://replicate.delivery/pbxt/KAr5swy9Bdkv4cM2IKAvLoxCMWtLLmMLFSK1SpwTLDxzdYgW/sloth-mask.png", "reference_image_path": "https://replicate.delivery/pbxt/KAr5sJGlXZyZPR2SfOduHMvnUgS1CIc81ynRVCdHV24JdTo0/sloth.png" }, "logs": "Using seed: 2627894035\nData shape for DDIM sampling is (1, 4, 64, 64), eta 0.0\nRunning DDIM Sampling with 31 timesteps\nDDIM Sampler: 0%| | 0/31 [00:00<?, ?it/s]\nDDIM Sampler: 3%|▎ | 1/31 [00:00<00:04, 6.18it/s]\nDDIM Sampler: 6%|▋ | 2/31 [00:00<00:04, 6.25it/s]\nDDIM Sampler: 10%|▉ | 3/31 [00:00<00:04, 6.28it/s]\nDDIM Sampler: 13%|█▎ | 4/31 [00:00<00:04, 6.29it/s]\nDDIM Sampler: 16%|█▌ | 5/31 [00:00<00:04, 6.29it/s]\nDDIM Sampler: 19%|█▉ | 6/31 [00:00<00:03, 6.28it/s]\nDDIM Sampler: 23%|██▎ | 7/31 [00:01<00:03, 6.28it/s]\nDDIM Sampler: 26%|██▌ | 8/31 [00:01<00:03, 6.28it/s]\nDDIM Sampler: 29%|██▉ | 9/31 [00:01<00:03, 6.28it/s]\nDDIM Sampler: 32%|███▏ | 10/31 [00:01<00:03, 6.27it/s]\nDDIM Sampler: 35%|███▌ | 11/31 [00:01<00:03, 6.27it/s]\nDDIM Sampler: 39%|███▊ | 12/31 [00:01<00:03, 6.28it/s]\nDDIM Sampler: 42%|████▏ | 13/31 [00:02<00:02, 6.28it/s]\nDDIM Sampler: 45%|████▌ | 14/31 [00:02<00:02, 6.29it/s]\nDDIM Sampler: 48%|████▊ | 15/31 [00:02<00:02, 6.31it/s]\nDDIM Sampler: 52%|█████▏ | 16/31 [00:02<00:02, 6.32it/s]\nDDIM Sampler: 55%|█████▍ | 17/31 [00:02<00:02, 6.33it/s]\nDDIM Sampler: 58%|█████▊ | 18/31 [00:02<00:02, 6.33it/s]\nDDIM Sampler: 61%|██████▏ | 19/31 [00:03<00:01, 6.33it/s]\nDDIM Sampler: 65%|██████▍ | 20/31 [00:03<00:01, 6.33it/s]\nDDIM Sampler: 68%|██████▊ | 21/31 [00:03<00:01, 6.33it/s]\nDDIM Sampler: 71%|███████ | 22/31 [00:03<00:01, 6.33it/s]\nDDIM Sampler: 74%|███████▍ | 23/31 [00:03<00:01, 6.33it/s]\nDDIM Sampler: 77%|███████▋ | 24/31 [00:03<00:01, 6.33it/s]\nDDIM Sampler: 81%|████████ | 25/31 [00:03<00:00, 6.33it/s]\nDDIM Sampler: 84%|████████▍ | 26/31 [00:04<00:00, 6.33it/s]\nDDIM Sampler: 87%|████████▋ | 27/31 [00:04<00:00, 6.33it/s]\nDDIM Sampler: 90%|█████████ | 28/31 [00:04<00:00, 6.33it/s]\nDDIM Sampler: 94%|█████████▎| 29/31 [00:04<00:00, 6.33it/s]\nDDIM Sampler: 97%|█████████▋| 30/31 [00:04<00:00, 6.32it/s]\nDDIM Sampler: 100%|██████████| 31/31 [00:04<00:00, 6.32it/s]\nDDIM Sampler: 100%|██████████| 31/31 [00:04<00:00, 6.31it/s]", "metrics": { "predict_time": 7.787525, "total_time": 7.823332 }, "output": "https://replicate.delivery/pbxt/1yuh0r2VbN6mK50eijySUVLRGrFqtvpBb6ICrVSdcBam5uEJA/output.png", "started_at": "2024-01-05T16:13:57.291236Z", "status": "succeeded", "urls": { "get": "https://api.replicate.com/v1/predictions/vtxdxidb4u2u64w7ffou7tdvgy", "cancel": "https://api.replicate.com/v1/predictions/vtxdxidb4u2u64w7ffou7tdvgy/cancel" }, "version": "542c963129c4661ab53a875b1b9a84b2102ca784cf872ef2752a468721c0eb2a" }
Generated inUsing seed: 2627894035 Data shape for DDIM sampling is (1, 4, 64, 64), eta 0.0 Running DDIM Sampling with 31 timesteps DDIM Sampler: 0%| | 0/31 [00:00<?, ?it/s] DDIM Sampler: 3%|▎ | 1/31 [00:00<00:04, 6.18it/s] DDIM Sampler: 6%|▋ | 2/31 [00:00<00:04, 6.25it/s] DDIM Sampler: 10%|▉ | 3/31 [00:00<00:04, 6.28it/s] DDIM Sampler: 13%|█▎ | 4/31 [00:00<00:04, 6.29it/s] DDIM Sampler: 16%|█▌ | 5/31 [00:00<00:04, 6.29it/s] DDIM Sampler: 19%|█▉ | 6/31 [00:00<00:03, 6.28it/s] DDIM Sampler: 23%|██▎ | 7/31 [00:01<00:03, 6.28it/s] DDIM Sampler: 26%|██▌ | 8/31 [00:01<00:03, 6.28it/s] DDIM Sampler: 29%|██▉ | 9/31 [00:01<00:03, 6.28it/s] DDIM Sampler: 32%|███▏ | 10/31 [00:01<00:03, 6.27it/s] DDIM Sampler: 35%|███▌ | 11/31 [00:01<00:03, 6.27it/s] DDIM Sampler: 39%|███▊ | 12/31 [00:01<00:03, 6.28it/s] DDIM Sampler: 42%|████▏ | 13/31 [00:02<00:02, 6.28it/s] DDIM Sampler: 45%|████▌ | 14/31 [00:02<00:02, 6.29it/s] DDIM Sampler: 48%|████▊ | 15/31 [00:02<00:02, 6.31it/s] DDIM Sampler: 52%|█████▏ | 16/31 [00:02<00:02, 6.32it/s] DDIM Sampler: 55%|█████▍ | 17/31 [00:02<00:02, 6.33it/s] DDIM Sampler: 58%|█████▊ | 18/31 [00:02<00:02, 6.33it/s] DDIM Sampler: 61%|██████▏ | 19/31 [00:03<00:01, 6.33it/s] DDIM Sampler: 65%|██████▍ | 20/31 [00:03<00:01, 6.33it/s] DDIM Sampler: 68%|██████▊ | 21/31 [00:03<00:01, 6.33it/s] DDIM Sampler: 71%|███████ | 22/31 [00:03<00:01, 6.33it/s] DDIM Sampler: 74%|███████▍ | 23/31 [00:03<00:01, 6.33it/s] DDIM Sampler: 77%|███████▋ | 24/31 [00:03<00:01, 6.33it/s] DDIM Sampler: 81%|████████ | 25/31 [00:03<00:00, 6.33it/s] DDIM Sampler: 84%|████████▍ | 26/31 [00:04<00:00, 6.33it/s] DDIM Sampler: 87%|████████▋ | 27/31 [00:04<00:00, 6.33it/s] DDIM Sampler: 90%|█████████ | 28/31 [00:04<00:00, 6.33it/s] DDIM Sampler: 94%|█████████▎| 29/31 [00:04<00:00, 6.33it/s] DDIM Sampler: 97%|█████████▋| 30/31 [00:04<00:00, 6.32it/s] DDIM Sampler: 100%|██████████| 31/31 [00:04<00:00, 6.32it/s] DDIM Sampler: 100%|██████████| 31/31 [00:04<00:00, 6.31it/s]
Want to make some of these yourself?
Run this model