Readme
This model doesn't have a readme.
XLabs v3 canny, depth and soft edge controlnets for Flux.1 Dev
Run this model in Node.js with one line of code:
npm install replicate
REPLICATE_API_TOKEN
environment variableexport 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 xlabs-ai/flux-dev-controlnet using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"xlabs-ai/flux-dev-controlnet:9a8db105db745f8b11ad3afe5c8bd892428b2a43ade0b67edc4e0ccd52ff2fda",
{
input: {
steps: 28,
prompt: "a cyberpunk with natural greys and whites and browns",
lora_url: "",
control_type: "depth",
control_image: "https://replicate.delivery/pbxt/LUSNInCegT0XwStCCJjXOojSBhPjpk2Pzj5VNjksiP9cER8A/ComfyUI_02172_.png",
lora_strength: 1,
output_format: "webp",
guidance_scale: 2.5,
output_quality: 100,
negative_prompt: "low quality, ugly, distorted, artefacts",
control_strength: 0.45,
depth_preprocessor: "DepthAnything",
soft_edge_preprocessor: "HED",
image_to_image_strength: 0,
return_preprocessed_image: false
}
}
);
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 variableexport REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
import replicate
Run xlabs-ai/flux-dev-controlnet using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"xlabs-ai/flux-dev-controlnet:9a8db105db745f8b11ad3afe5c8bd892428b2a43ade0b67edc4e0ccd52ff2fda",
input={
"steps": 28,
"prompt": "a cyberpunk with natural greys and whites and browns",
"lora_url": "",
"control_type": "depth",
"control_image": "https://replicate.delivery/pbxt/LUSNInCegT0XwStCCJjXOojSBhPjpk2Pzj5VNjksiP9cER8A/ComfyUI_02172_.png",
"lora_strength": 1,
"output_format": "webp",
"guidance_scale": 2.5,
"output_quality": 100,
"negative_prompt": "low quality, ugly, distorted, artefacts",
"control_strength": 0.45,
"depth_preprocessor": "DepthAnything",
"soft_edge_preprocessor": "HED",
"image_to_image_strength": 0,
"return_preprocessed_image": False
}
)
print(output)
To learn more, take a look at the guide on getting started with Python.
REPLICATE_API_TOKEN
environment variableexport REPLICATE_API_TOKEN=<paste-your-token-here>
Find your API token in your account settings.
Run xlabs-ai/flux-dev-controlnet 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": "9a8db105db745f8b11ad3afe5c8bd892428b2a43ade0b67edc4e0ccd52ff2fda",
"input": {
"steps": 28,
"prompt": "a cyberpunk with natural greys and whites and browns",
"lora_url": "",
"control_type": "depth",
"control_image": "https://replicate.delivery/pbxt/LUSNInCegT0XwStCCJjXOojSBhPjpk2Pzj5VNjksiP9cER8A/ComfyUI_02172_.png",
"lora_strength": 1,
"output_format": "webp",
"guidance_scale": 2.5,
"output_quality": 100,
"negative_prompt": "low quality, ugly, distorted, artefacts",
"control_strength": 0.45,
"depth_preprocessor": "DepthAnything",
"soft_edge_preprocessor": "HED",
"image_to_image_strength": 0,
"return_preprocessed_image": false
}
}' \
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.
Pull and run xlabs-ai/flux-dev-controlnet using Cog (this will download the full model and run it in your local environment):
cog predict r8.im/xlabs-ai/flux-dev-controlnet@sha256:9a8db105db745f8b11ad3afe5c8bd892428b2a43ade0b67edc4e0ccd52ff2fda \
-i 'steps=28' \
-i 'prompt="a cyberpunk with natural greys and whites and browns"' \
-i 'lora_url=""' \
-i 'control_type="depth"' \
-i 'control_image="https://replicate.delivery/pbxt/LUSNInCegT0XwStCCJjXOojSBhPjpk2Pzj5VNjksiP9cER8A/ComfyUI_02172_.png"' \
-i 'lora_strength=1' \
-i 'output_format="webp"' \
-i 'guidance_scale=2.5' \
-i 'output_quality=100' \
-i 'negative_prompt="low quality, ugly, distorted, artefacts"' \
-i 'control_strength=0.45' \
-i 'depth_preprocessor="DepthAnything"' \
-i 'soft_edge_preprocessor="HED"' \
-i 'image_to_image_strength=0' \
-i 'return_preprocessed_image=false'
To learn more, take a look at the Cog documentation.
Pull and run xlabs-ai/flux-dev-controlnet using Docker (this will download the full model and run it in your local environment):
docker run -d -p 5000:5000 --gpus=all r8.im/xlabs-ai/flux-dev-controlnet@sha256:9a8db105db745f8b11ad3afe5c8bd892428b2a43ade0b67edc4e0ccd52ff2fda
curl -s -X POST \ -H "Content-Type: application/json" \ -d $'{ "input": { "steps": 28, "prompt": "a cyberpunk with natural greys and whites and browns", "lora_url": "", "control_type": "depth", "control_image": "https://replicate.delivery/pbxt/LUSNInCegT0XwStCCJjXOojSBhPjpk2Pzj5VNjksiP9cER8A/ComfyUI_02172_.png", "lora_strength": 1, "output_format": "webp", "guidance_scale": 2.5, "output_quality": 100, "negative_prompt": "low quality, ugly, distorted, artefacts", "control_strength": 0.45, "depth_preprocessor": "DepthAnything", "soft_edge_preprocessor": "HED", "image_to_image_strength": 0, "return_preprocessed_image": false } }' \ http://localhost:5000/predictions
Add a payment method to run this model.
Each run costs approximately $0.11. Alternatively, try out our featured models for free.
By signing in, you agree to our
terms of service and privacy policy
{
"completed_at": "2024-08-22T13:37:41.573945Z",
"created_at": "2024-08-22T13:37:11.110000Z",
"data_removed": false,
"error": null,
"id": "1d6k7rhkrsrj60chf9780at1q0",
"input": {
"steps": 28,
"prompt": "a cyberpunk with natural greys and whites and browns",
"control_type": "depth",
"control_image": "https://replicate.delivery/pbxt/LUSNInCegT0XwStCCJjXOojSBhPjpk2Pzj5VNjksiP9cER8A/ComfyUI_02172_.png",
"output_format": "webp",
"guidance_scale": 2.5,
"output_quality": 100,
"negative_prompt": "low quality, ugly, distorted, artefacts",
"control_strength": 0.45,
"depth_preprocessor": "DepthAnything",
"soft_edge_preprocessor": "HED",
"image_to_image_strength": 0,
"return_preprocessed_image": false
},
"logs": "Random seed set to: 4284057858\nChecking inputs\n✅ /tmp/inputs/control_image.png\n====================================\nChecking weights\n✅ t5xxl_fp8_e4m3fn.safetensors exists in ComfyUI/models/clip\n✅ flux-depth-controlnet-v3.safetensors exists in ComfyUI/models/xlabs/controlnets/\n✅ depth_anything_vitl14.pth exists in ComfyUI/custom_nodes/comfyui_controlnet_aux/ckpts/LiheYoung/Depth-Anything/checkpoints\n✅ depth_anything_vitb14.pth exists in ComfyUI/custom_nodes/comfyui_controlnet_aux/ckpts/LiheYoung/Depth-Anything/checkpoints\n✅ ae.safetensors exists in ComfyUI/models/vae\n✅ clip_l.safetensors exists in ComfyUI/models/clip\n✅ depth_anything_vits14.pth exists in ComfyUI/custom_nodes/comfyui_controlnet_aux/ckpts/LiheYoung/Depth-Anything/checkpoints\n✅ flux1-dev.safetensors exists in ComfyUI/models/diffusion_models\n====================================\nRunning workflow\ngot prompt\nExecuting node 53, title: CLIPTextEncodeFlux, class type: CLIPTextEncodeFlux\nExecuting node 3, title: Xlabs Sampler, class type: XlabsSampler\nSampling: 0%| | 0/28 [00:00<?, ?it/s]\nSampling: 4%|▎ | 1/28 [00:00<00:09, 2.92it/s]\nSampling: 7%|▋ | 2/28 [00:01<00:19, 1.33it/s]\nSampling: 11%|█ | 3/28 [00:02<00:22, 1.13it/s]\nSampling: 14%|█▍ | 4/28 [00:03<00:22, 1.06it/s]\nSampling: 18%|█▊ | 5/28 [00:04<00:22, 1.02it/s]\nSampling: 21%|██▏ | 6/28 [00:05<00:21, 1.00it/s]\nSampling: 25%|██▌ | 7/28 [00:06<00:21, 1.01s/it]\nSampling: 29%|██▊ | 8/28 [00:07<00:20, 1.02s/it]\nSampling: 32%|███▏ | 9/28 [00:08<00:19, 1.03s/it]\nSampling: 36%|███▌ | 10/28 [00:09<00:18, 1.03s/it]\nSampling: 39%|███▉ | 11/28 [00:10<00:17, 1.04s/it]\nSampling: 43%|████▎ | 12/28 [00:11<00:16, 1.04s/it]\nSampling: 46%|████▋ | 13/28 [00:12<00:15, 1.04s/it]\nSampling: 50%|█████ | 14/28 [00:13<00:14, 1.04s/it]\nSampling: 54%|█████▎ | 15/28 [00:14<00:13, 1.04s/it]\nSampling: 57%|█████▋ | 16/28 [00:15<00:12, 1.04s/it]\nSampling: 61%|██████ | 17/28 [00:17<00:11, 1.04s/it]\nSampling: 64%|██████▍ | 18/28 [00:18<00:10, 1.05s/it]\nSampling: 68%|██████▊ | 19/28 [00:19<00:09, 1.05s/it]\nSampling: 71%|███████▏ | 20/28 [00:20<00:08, 1.05s/it]\nSampling: 75%|███████▌ | 21/28 [00:21<00:07, 1.05s/it]\nSampling: 79%|███████▊ | 22/28 [00:22<00:06, 1.05s/it]\nSampling: 82%|████████▏ | 23/28 [00:23<00:05, 1.05s/it]\nSampling: 86%|████████▌ | 24/28 [00:24<00:04, 1.05s/it]\nSampling: 89%|████████▉ | 25/28 [00:25<00:03, 1.05s/it]\nSampling: 93%|█████████▎| 26/28 [00:26<00:02, 1.05s/it]\nSampling: 96%|█████████▋| 27/28 [00:27<00:01, 1.05s/it]\nSampling: 100%|██████████| 28/28 [00:28<00:00, 1.05s/it]\nSampling: 100%|██████████| 28/28 [00:28<00:00, 1.02s/it]\nExecuting node 7, title: VAE Decode, class type: VAEDecode\nExecuting node 23, title: Save Image, class type: SaveImage\nPrompt executed in 29.30 seconds\noutputs: {'39': {'images': [{'filename': 'ComfyUI_temp_iyiyo_00001_.png', 'subfolder': '', 'type': 'temp'}]}, '23': {'images': [{'filename': 'R8_FLUX_XLABS_00001_.png', 'subfolder': '', 'type': 'output'}]}}\n====================================\nR8_FLUX_XLABS_00001_.png",
"metrics": {
"predict_time": 30.453438169000002,
"total_time": 30.463945
},
"output": [
"https://replicate.delivery/yhqm/bevnypBnKcWFQqRpBDd4pEAOZ8f16tRLVZgd4TAklUslEPVTA/R8_FLUX_XLABS_00001_.webp"
],
"started_at": "2024-08-22T13:37:11.120506Z",
"status": "succeeded",
"urls": {
"get": "https://api.replicate.com/v1/predictions/1d6k7rhkrsrj60chf9780at1q0",
"cancel": "https://api.replicate.com/v1/predictions/1d6k7rhkrsrj60chf9780at1q0/cancel"
},
"version": "56ac7b66bd9a1b5eb7d15da5ac5625e4c8c9c5bc26da892caf6249cf38a611ed"
}
Random seed set to: 4284057858
Checking inputs
✅ /tmp/inputs/control_image.png
====================================
Checking weights
✅ t5xxl_fp8_e4m3fn.safetensors exists in ComfyUI/models/clip
✅ flux-depth-controlnet-v3.safetensors exists in ComfyUI/models/xlabs/controlnets/
✅ depth_anything_vitl14.pth exists in ComfyUI/custom_nodes/comfyui_controlnet_aux/ckpts/LiheYoung/Depth-Anything/checkpoints
✅ depth_anything_vitb14.pth exists in ComfyUI/custom_nodes/comfyui_controlnet_aux/ckpts/LiheYoung/Depth-Anything/checkpoints
✅ ae.safetensors exists in ComfyUI/models/vae
✅ clip_l.safetensors exists in ComfyUI/models/clip
✅ depth_anything_vits14.pth exists in ComfyUI/custom_nodes/comfyui_controlnet_aux/ckpts/LiheYoung/Depth-Anything/checkpoints
✅ flux1-dev.safetensors exists in ComfyUI/models/diffusion_models
====================================
Running workflow
got prompt
Executing node 53, title: CLIPTextEncodeFlux, class type: CLIPTextEncodeFlux
Executing node 3, title: Xlabs Sampler, class type: XlabsSampler
Sampling: 0%| | 0/28 [00:00<?, ?it/s]
Sampling: 4%|▎ | 1/28 [00:00<00:09, 2.92it/s]
Sampling: 7%|▋ | 2/28 [00:01<00:19, 1.33it/s]
Sampling: 11%|█ | 3/28 [00:02<00:22, 1.13it/s]
Sampling: 14%|█▍ | 4/28 [00:03<00:22, 1.06it/s]
Sampling: 18%|█▊ | 5/28 [00:04<00:22, 1.02it/s]
Sampling: 21%|██▏ | 6/28 [00:05<00:21, 1.00it/s]
Sampling: 25%|██▌ | 7/28 [00:06<00:21, 1.01s/it]
Sampling: 29%|██▊ | 8/28 [00:07<00:20, 1.02s/it]
Sampling: 32%|███▏ | 9/28 [00:08<00:19, 1.03s/it]
Sampling: 36%|███▌ | 10/28 [00:09<00:18, 1.03s/it]
Sampling: 39%|███▉ | 11/28 [00:10<00:17, 1.04s/it]
Sampling: 43%|████▎ | 12/28 [00:11<00:16, 1.04s/it]
Sampling: 46%|████▋ | 13/28 [00:12<00:15, 1.04s/it]
Sampling: 50%|█████ | 14/28 [00:13<00:14, 1.04s/it]
Sampling: 54%|█████▎ | 15/28 [00:14<00:13, 1.04s/it]
Sampling: 57%|█████▋ | 16/28 [00:15<00:12, 1.04s/it]
Sampling: 61%|██████ | 17/28 [00:17<00:11, 1.04s/it]
Sampling: 64%|██████▍ | 18/28 [00:18<00:10, 1.05s/it]
Sampling: 68%|██████▊ | 19/28 [00:19<00:09, 1.05s/it]
Sampling: 71%|███████▏ | 20/28 [00:20<00:08, 1.05s/it]
Sampling: 75%|███████▌ | 21/28 [00:21<00:07, 1.05s/it]
Sampling: 79%|███████▊ | 22/28 [00:22<00:06, 1.05s/it]
Sampling: 82%|████████▏ | 23/28 [00:23<00:05, 1.05s/it]
Sampling: 86%|████████▌ | 24/28 [00:24<00:04, 1.05s/it]
Sampling: 89%|████████▉ | 25/28 [00:25<00:03, 1.05s/it]
Sampling: 93%|█████████▎| 26/28 [00:26<00:02, 1.05s/it]
Sampling: 96%|█████████▋| 27/28 [00:27<00:01, 1.05s/it]
Sampling: 100%|██████████| 28/28 [00:28<00:00, 1.05s/it]
Sampling: 100%|██████████| 28/28 [00:28<00:00, 1.02s/it]
Executing node 7, title: VAE Decode, class type: VAEDecode
Executing node 23, title: Save Image, class type: SaveImage
Prompt executed in 29.30 seconds
outputs: {'39': {'images': [{'filename': 'ComfyUI_temp_iyiyo_00001_.png', 'subfolder': '', 'type': 'temp'}]}, '23': {'images': [{'filename': 'R8_FLUX_XLABS_00001_.png', 'subfolder': '', 'type': 'output'}]}}
====================================
R8_FLUX_XLABS_00001_.png
This example was created by a different version, xlabs-ai/flux-dev-controlnet:56ac7b66.
This model costs approximately $0.11 to run on Replicate, or 9 runs per $1, but this varies depending on your inputs. It is also open source and you can run it on your own computer with Docker.
This model runs on Nvidia A100 (80GB) GPU hardware. Predictions typically complete within 83 seconds. The predict time for this model varies significantly based on the inputs.
This model doesn't have a readme.
This model is cold. You'll get a fast response if the model is warm and already running, and a slower response if the model is cold and starting up.
Choose a file from your machine
Hint: you can also drag files onto the input
Random seed set to: 4284057858
Checking inputs
✅ /tmp/inputs/control_image.png
====================================
Checking weights
✅ t5xxl_fp8_e4m3fn.safetensors exists in ComfyUI/models/clip
✅ flux-depth-controlnet-v3.safetensors exists in ComfyUI/models/xlabs/controlnets/
✅ depth_anything_vitl14.pth exists in ComfyUI/custom_nodes/comfyui_controlnet_aux/ckpts/LiheYoung/Depth-Anything/checkpoints
✅ depth_anything_vitb14.pth exists in ComfyUI/custom_nodes/comfyui_controlnet_aux/ckpts/LiheYoung/Depth-Anything/checkpoints
✅ ae.safetensors exists in ComfyUI/models/vae
✅ clip_l.safetensors exists in ComfyUI/models/clip
✅ depth_anything_vits14.pth exists in ComfyUI/custom_nodes/comfyui_controlnet_aux/ckpts/LiheYoung/Depth-Anything/checkpoints
✅ flux1-dev.safetensors exists in ComfyUI/models/diffusion_models
====================================
Running workflow
got prompt
Executing node 53, title: CLIPTextEncodeFlux, class type: CLIPTextEncodeFlux
Executing node 3, title: Xlabs Sampler, class type: XlabsSampler
Sampling: 0%| | 0/28 [00:00<?, ?it/s]
Sampling: 4%|▎ | 1/28 [00:00<00:09, 2.92it/s]
Sampling: 7%|▋ | 2/28 [00:01<00:19, 1.33it/s]
Sampling: 11%|█ | 3/28 [00:02<00:22, 1.13it/s]
Sampling: 14%|█▍ | 4/28 [00:03<00:22, 1.06it/s]
Sampling: 18%|█▊ | 5/28 [00:04<00:22, 1.02it/s]
Sampling: 21%|██▏ | 6/28 [00:05<00:21, 1.00it/s]
Sampling: 25%|██▌ | 7/28 [00:06<00:21, 1.01s/it]
Sampling: 29%|██▊ | 8/28 [00:07<00:20, 1.02s/it]
Sampling: 32%|███▏ | 9/28 [00:08<00:19, 1.03s/it]
Sampling: 36%|███▌ | 10/28 [00:09<00:18, 1.03s/it]
Sampling: 39%|███▉ | 11/28 [00:10<00:17, 1.04s/it]
Sampling: 43%|████▎ | 12/28 [00:11<00:16, 1.04s/it]
Sampling: 46%|████▋ | 13/28 [00:12<00:15, 1.04s/it]
Sampling: 50%|█████ | 14/28 [00:13<00:14, 1.04s/it]
Sampling: 54%|█████▎ | 15/28 [00:14<00:13, 1.04s/it]
Sampling: 57%|█████▋ | 16/28 [00:15<00:12, 1.04s/it]
Sampling: 61%|██████ | 17/28 [00:17<00:11, 1.04s/it]
Sampling: 64%|██████▍ | 18/28 [00:18<00:10, 1.05s/it]
Sampling: 68%|██████▊ | 19/28 [00:19<00:09, 1.05s/it]
Sampling: 71%|███████▏ | 20/28 [00:20<00:08, 1.05s/it]
Sampling: 75%|███████▌ | 21/28 [00:21<00:07, 1.05s/it]
Sampling: 79%|███████▊ | 22/28 [00:22<00:06, 1.05s/it]
Sampling: 82%|████████▏ | 23/28 [00:23<00:05, 1.05s/it]
Sampling: 86%|████████▌ | 24/28 [00:24<00:04, 1.05s/it]
Sampling: 89%|████████▉ | 25/28 [00:25<00:03, 1.05s/it]
Sampling: 93%|█████████▎| 26/28 [00:26<00:02, 1.05s/it]
Sampling: 96%|█████████▋| 27/28 [00:27<00:01, 1.05s/it]
Sampling: 100%|██████████| 28/28 [00:28<00:00, 1.05s/it]
Sampling: 100%|██████████| 28/28 [00:28<00:00, 1.02s/it]
Executing node 7, title: VAE Decode, class type: VAEDecode
Executing node 23, title: Save Image, class type: SaveImage
Prompt executed in 29.30 seconds
outputs: {'39': {'images': [{'filename': 'ComfyUI_temp_iyiyo_00001_.png', 'subfolder': '', 'type': 'temp'}]}, '23': {'images': [{'filename': 'R8_FLUX_XLABS_00001_.png', 'subfolder': '', 'type': 'output'}]}}
====================================
R8_FLUX_XLABS_00001_.png