You're looking at a specific version of this model. Jump to the model overview.
adirik /masactrl-anything-v4-0:9db49bf5
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 adirik/masactrl-anything-v4-0 using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"adirik/masactrl-anything-v4-0:9db49bf5fcedfb9279471e89b1daa326308ddaf633179d52f8695c47cfbe0800",
{
input: {
source_prompt: "1boy, casual, outdoors, sitting",
target_prompt: "1boy, casual, outdoors, standing",
guidance_scale: 7.5,
masactrl_start_step: 4,
num_inference_steps: 50,
masactrl_start_layer: 10
}
}
);
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 adirik/masactrl-anything-v4-0 using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"adirik/masactrl-anything-v4-0:9db49bf5fcedfb9279471e89b1daa326308ddaf633179d52f8695c47cfbe0800",
input={
"source_prompt": "1boy, casual, outdoors, sitting",
"target_prompt": "1boy, casual, outdoors, standing",
"guidance_scale": 7.5,
"masactrl_start_step": 4,
"num_inference_steps": 50,
"masactrl_start_layer": 10
}
)
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 adirik/masactrl-anything-v4-0 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": "9db49bf5fcedfb9279471e89b1daa326308ddaf633179d52f8695c47cfbe0800",
"input": {
"source_prompt": "1boy, casual, outdoors, sitting",
"target_prompt": "1boy, casual, outdoors, standing",
"guidance_scale": 7.5,
"masactrl_start_step": 4,
"num_inference_steps": 50,
"masactrl_start_layer": 10
}
}' \
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/adirik/masactrl-anything-v4-0@sha256:9db49bf5fcedfb9279471e89b1daa326308ddaf633179d52f8695c47cfbe0800 \
-i 'source_prompt="1boy, casual, outdoors, sitting"' \
-i 'target_prompt="1boy, casual, outdoors, standing"' \
-i 'guidance_scale=7.5' \
-i 'masactrl_start_step=4' \
-i 'num_inference_steps=50' \
-i 'masactrl_start_layer=10'
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/adirik/masactrl-anything-v4-0@sha256:9db49bf5fcedfb9279471e89b1daa326308ddaf633179d52f8695c47cfbe0800
curl -s -X POST \ -H "Content-Type: application/json" \ -d $'{ "input": { "source_prompt": "1boy, casual, outdoors, sitting", "target_prompt": "1boy, casual, outdoors, standing", "guidance_scale": 7.5, "masactrl_start_step": 4, "num_inference_steps": 50, "masactrl_start_layer": 10 } }' \ 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.12. Alternatively, try out our featured models for free.
By signing in, you agree to our
terms of service and privacy policy
Output
{
"completed_at": "2023-12-05T10:13:45.252553Z",
"created_at": "2023-12-05T10:13:23.700571Z",
"data_removed": false,
"error": null,
"id": "puk7yk3b7aqhegw24tbbb7i6ry",
"input": {
"source_prompt": "1boy, casual, outdoors, sitting",
"target_prompt": "1boy, casual, outdoors, standing",
"guidance_scale": 7.5,
"masactrl_start_step": 4,
"num_inference_steps": 50,
"masactrl_start_layer": 10
},
"logs": "/root/.pyenv/versions/3.11.6/lib/python3.11/site-packages/lightning_fabric/utilities/seed.py:40: No seed found, seed set to 3047472308\nSeed set to 3047472308\nMasaCtrl at denoising steps: [4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49]\nMasaCtrl at U-Net layers: [10, 11, 12, 13, 14, 15]\ninput text embeddings : torch.Size([2, 77, 768])\n/src/masactrl/diffuser_utils.py:139: FutureWarning: Accessing config attribute `in_channels` directly via 'UNet2DConditionModel' object attribute is deprecated. Please access 'in_channels' over 'UNet2DConditionModel's config object instead, e.g. 'unet.config.in_channels'.\nlatents_shape = (batch_size, self.unet.in_channels, height//8, width//8)\nlatents shape: torch.Size([2, 4, 64, 64])\nDDIM Sampler: 0%| | 0/50 [00:00<?, ?it/s]\nDDIM Sampler: 2%|▏ | 1/50 [00:00<00:29, 1.65it/s]\nDDIM Sampler: 4%|▍ | 2/50 [00:00<00:19, 2.50it/s]\nDDIM Sampler: 6%|▌ | 3/50 [00:01<00:15, 2.95it/s]\nDDIM Sampler: 8%|▊ | 4/50 [00:01<00:14, 3.22it/s]\nDDIM Sampler: 10%|█ | 5/50 [00:01<00:13, 3.36it/s]\nDDIM Sampler: 12%|█▏ | 6/50 [00:01<00:13, 3.25it/s]\nDDIM Sampler: 14%|█▍ | 7/50 [00:02<00:13, 3.17it/s]\nDDIM Sampler: 16%|█▌ | 8/50 [00:02<00:13, 3.13it/s]\nDDIM Sampler: 18%|█▊ | 9/50 [00:02<00:13, 3.10it/s]\nDDIM Sampler: 20%|██ | 10/50 [00:03<00:12, 3.08it/s]\nDDIM Sampler: 22%|██▏ | 11/50 [00:03<00:12, 3.06it/s]\nDDIM Sampler: 24%|██▍ | 12/50 [00:03<00:12, 3.06it/s]\nDDIM Sampler: 26%|██▌ | 13/50 [00:04<00:12, 3.05it/s]\nDDIM Sampler: 28%|██▊ | 14/50 [00:04<00:11, 3.04it/s]\nDDIM Sampler: 30%|███ | 15/50 [00:04<00:11, 3.04it/s]\nDDIM Sampler: 32%|███▏ | 16/50 [00:05<00:11, 3.04it/s]\nDDIM Sampler: 34%|███▍ | 17/50 [00:05<00:10, 3.04it/s]\nDDIM Sampler: 36%|███▌ | 18/50 [00:05<00:10, 3.04it/s]\nDDIM Sampler: 38%|███▊ | 19/50 [00:06<00:10, 3.03it/s]\nDDIM Sampler: 40%|████ | 20/50 [00:06<00:09, 3.03it/s]\nDDIM Sampler: 42%|████▏ | 21/50 [00:06<00:09, 3.03it/s]\nDDIM Sampler: 44%|████▍ | 22/50 [00:07<00:09, 3.03it/s]\nDDIM Sampler: 46%|████▌ | 23/50 [00:07<00:08, 3.03it/s]\nDDIM Sampler: 48%|████▊ | 24/50 [00:07<00:08, 3.03it/s]\nDDIM Sampler: 50%|█████ | 25/50 [00:08<00:08, 3.03it/s]\nDDIM Sampler: 52%|█████▏ | 26/50 [00:08<00:07, 3.03it/s]\nDDIM Sampler: 54%|█████▍ | 27/50 [00:08<00:07, 3.03it/s]\nDDIM Sampler: 56%|█████▌ | 28/50 [00:09<00:07, 3.03it/s]\nDDIM Sampler: 58%|█████▊ | 29/50 [00:09<00:06, 3.03it/s]\nDDIM Sampler: 60%|██████ | 30/50 [00:09<00:06, 3.03it/s]\nDDIM Sampler: 62%|██████▏ | 31/50 [00:10<00:06, 3.03it/s]\nDDIM Sampler: 64%|██████▍ | 32/50 [00:10<00:05, 3.03it/s]\nDDIM Sampler: 66%|██████▌ | 33/50 [00:10<00:05, 3.03it/s]\nDDIM Sampler: 68%|██████▊ | 34/50 [00:11<00:05, 3.03it/s]\nDDIM Sampler: 70%|███████ | 35/50 [00:11<00:04, 3.03it/s]\nDDIM Sampler: 72%|███████▏ | 36/50 [00:11<00:04, 3.03it/s]\nDDIM Sampler: 74%|███████▍ | 37/50 [00:12<00:04, 3.03it/s]\nDDIM Sampler: 76%|███████▌ | 38/50 [00:12<00:03, 3.03it/s]\nDDIM Sampler: 78%|███████▊ | 39/50 [00:12<00:03, 3.03it/s]\nDDIM Sampler: 80%|████████ | 40/50 [00:13<00:03, 3.03it/s]\nDDIM Sampler: 82%|████████▏ | 41/50 [00:13<00:02, 3.03it/s]\nDDIM Sampler: 84%|████████▍ | 42/50 [00:13<00:02, 3.04it/s]\nDDIM Sampler: 86%|████████▌ | 43/50 [00:14<00:02, 3.04it/s]\nDDIM Sampler: 88%|████████▊ | 44/50 [00:14<00:01, 3.04it/s]\nDDIM Sampler: 90%|█████████ | 45/50 [00:14<00:01, 3.04it/s]\nDDIM Sampler: 92%|█████████▏| 46/50 [00:15<00:01, 3.04it/s]\nDDIM Sampler: 94%|█████████▍| 47/50 [00:15<00:00, 3.04it/s]\nDDIM Sampler: 96%|█████████▌| 48/50 [00:15<00:00, 3.04it/s]\nDDIM Sampler: 98%|█████████▊| 49/50 [00:16<00:00, 3.04it/s]\nDDIM Sampler: 100%|██████████| 50/50 [00:16<00:00, 3.04it/s]\nDDIM Sampler: 100%|██████████| 50/50 [00:16<00:00, 3.03it/s]",
"metrics": {
"predict_time": 19.410476,
"total_time": 21.551982
},
"output": [
"https://replicate.delivery/pbxt/UuTJV6Ue3gWBcCf3zMY8yErLd7VEXuBOFDaQ1IbfTjFuOVeHB/synt_0.png",
"https://replicate.delivery/pbxt/Pgiaeeu4h9gVWEbXWo2IFYCC0zKVofM5gPD8E12SrATwOVeHB/synt_1.png"
],
"started_at": "2023-12-05T10:13:25.842077Z",
"status": "succeeded",
"urls": {
"get": "https://api.replicate.com/v1/predictions/puk7yk3b7aqhegw24tbbb7i6ry",
"cancel": "https://api.replicate.com/v1/predictions/puk7yk3b7aqhegw24tbbb7i6ry/cancel"
},
"version": "9db49bf5fcedfb9279471e89b1daa326308ddaf633179d52f8695c47cfbe0800"
}
/root/.pyenv/versions/3.11.6/lib/python3.11/site-packages/lightning_fabric/utilities/seed.py:40: No seed found, seed set to 3047472308
Seed set to 3047472308
MasaCtrl at denoising steps: [4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49]
MasaCtrl at U-Net layers: [10, 11, 12, 13, 14, 15]
input text embeddings : torch.Size([2, 77, 768])
/src/masactrl/diffuser_utils.py:139: FutureWarning: Accessing config attribute `in_channels` directly via 'UNet2DConditionModel' object attribute is deprecated. Please access 'in_channels' over 'UNet2DConditionModel's config object instead, e.g. 'unet.config.in_channels'.
latents_shape = (batch_size, self.unet.in_channels, height//8, width//8)
latents shape: torch.Size([2, 4, 64, 64])
DDIM Sampler: 0%| | 0/50 [00:00<?, ?it/s]
DDIM Sampler: 2%|▏ | 1/50 [00:00<00:29, 1.65it/s]
DDIM Sampler: 4%|▍ | 2/50 [00:00<00:19, 2.50it/s]
DDIM Sampler: 6%|▌ | 3/50 [00:01<00:15, 2.95it/s]
DDIM Sampler: 8%|▊ | 4/50 [00:01<00:14, 3.22it/s]
DDIM Sampler: 10%|█ | 5/50 [00:01<00:13, 3.36it/s]
DDIM Sampler: 12%|█▏ | 6/50 [00:01<00:13, 3.25it/s]
DDIM Sampler: 14%|█▍ | 7/50 [00:02<00:13, 3.17it/s]
DDIM Sampler: 16%|█▌ | 8/50 [00:02<00:13, 3.13it/s]
DDIM Sampler: 18%|█▊ | 9/50 [00:02<00:13, 3.10it/s]
DDIM Sampler: 20%|██ | 10/50 [00:03<00:12, 3.08it/s]
DDIM Sampler: 22%|██▏ | 11/50 [00:03<00:12, 3.06it/s]
DDIM Sampler: 24%|██▍ | 12/50 [00:03<00:12, 3.06it/s]
DDIM Sampler: 26%|██▌ | 13/50 [00:04<00:12, 3.05it/s]
DDIM Sampler: 28%|██▊ | 14/50 [00:04<00:11, 3.04it/s]
DDIM Sampler: 30%|███ | 15/50 [00:04<00:11, 3.04it/s]
DDIM Sampler: 32%|███▏ | 16/50 [00:05<00:11, 3.04it/s]
DDIM Sampler: 34%|███▍ | 17/50 [00:05<00:10, 3.04it/s]
DDIM Sampler: 36%|███▌ | 18/50 [00:05<00:10, 3.04it/s]
DDIM Sampler: 38%|███▊ | 19/50 [00:06<00:10, 3.03it/s]
DDIM Sampler: 40%|████ | 20/50 [00:06<00:09, 3.03it/s]
DDIM Sampler: 42%|████▏ | 21/50 [00:06<00:09, 3.03it/s]
DDIM Sampler: 44%|████▍ | 22/50 [00:07<00:09, 3.03it/s]
DDIM Sampler: 46%|████▌ | 23/50 [00:07<00:08, 3.03it/s]
DDIM Sampler: 48%|████▊ | 24/50 [00:07<00:08, 3.03it/s]
DDIM Sampler: 50%|█████ | 25/50 [00:08<00:08, 3.03it/s]
DDIM Sampler: 52%|█████▏ | 26/50 [00:08<00:07, 3.03it/s]
DDIM Sampler: 54%|█████▍ | 27/50 [00:08<00:07, 3.03it/s]
DDIM Sampler: 56%|█████▌ | 28/50 [00:09<00:07, 3.03it/s]
DDIM Sampler: 58%|█████▊ | 29/50 [00:09<00:06, 3.03it/s]
DDIM Sampler: 60%|██████ | 30/50 [00:09<00:06, 3.03it/s]
DDIM Sampler: 62%|██████▏ | 31/50 [00:10<00:06, 3.03it/s]
DDIM Sampler: 64%|██████▍ | 32/50 [00:10<00:05, 3.03it/s]
DDIM Sampler: 66%|██████▌ | 33/50 [00:10<00:05, 3.03it/s]
DDIM Sampler: 68%|██████▊ | 34/50 [00:11<00:05, 3.03it/s]
DDIM Sampler: 70%|███████ | 35/50 [00:11<00:04, 3.03it/s]
DDIM Sampler: 72%|███████▏ | 36/50 [00:11<00:04, 3.03it/s]
DDIM Sampler: 74%|███████▍ | 37/50 [00:12<00:04, 3.03it/s]
DDIM Sampler: 76%|███████▌ | 38/50 [00:12<00:03, 3.03it/s]
DDIM Sampler: 78%|███████▊ | 39/50 [00:12<00:03, 3.03it/s]
DDIM Sampler: 80%|████████ | 40/50 [00:13<00:03, 3.03it/s]
DDIM Sampler: 82%|████████▏ | 41/50 [00:13<00:02, 3.03it/s]
DDIM Sampler: 84%|████████▍ | 42/50 [00:13<00:02, 3.04it/s]
DDIM Sampler: 86%|████████▌ | 43/50 [00:14<00:02, 3.04it/s]
DDIM Sampler: 88%|████████▊ | 44/50 [00:14<00:01, 3.04it/s]
DDIM Sampler: 90%|█████████ | 45/50 [00:14<00:01, 3.04it/s]
DDIM Sampler: 92%|█████████▏| 46/50 [00:15<00:01, 3.04it/s]
DDIM Sampler: 94%|█████████▍| 47/50 [00:15<00:00, 3.04it/s]
DDIM Sampler: 96%|█████████▌| 48/50 [00:15<00:00, 3.04it/s]
DDIM Sampler: 98%|█████████▊| 49/50 [00:16<00:00, 3.04it/s]
DDIM Sampler: 100%|██████████| 50/50 [00:16<00:00, 3.04it/s]
DDIM Sampler: 100%|██████████| 50/50 [00:16<00:00, 3.03it/s]