typefile
{
"a_prompt": "best quality, extremely detailed",
"ddim_steps": 20,
"detect_resolution": 512,
"eta": 0,
"guess_mode": false,
"image_resolution": 512,
"input_image_path": "https://replicate.delivery/pbxt/KSbEAl9T5UeDInRBNViM9xIpyYR2XNcRVqXC8gKJeWSfNe1y/point3d-commercial-imaging-ltd-nQlVMCHPysY-unsplash.jpg",
"n_prompt": "longbody, lowres, bad anatomy, bad hands, missing fingers, extra digit, fewer digits, cropped, worst quality, low quality",
"num_samples": 1,
"prompt": "Put furniture",
"scale": 9,
"seed": 3.5,
"strength": 1
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_1hf**********************************
This is your API token. Keep it to yourself.
import Replicate from "replicate";
const replicate = new Replicate({
auth: process.env.REPLICATE_API_TOKEN,
});
Run mohamad1998630/controlnet using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"mohamad1998630/controlnet:905298f5d96cb992b6133132b151d4029122599cfd57d7ceb4c4e447b2390855",
{
input: {
a_prompt: "best quality, extremely detailed",
ddim_steps: 20,
detect_resolution: 512,
eta: 0,
guess_mode: false,
image_resolution: 512,
input_image_path: "https://replicate.delivery/pbxt/KSbEAl9T5UeDInRBNViM9xIpyYR2XNcRVqXC8gKJeWSfNe1y/point3d-commercial-imaging-ltd-nQlVMCHPysY-unsplash.jpg",
n_prompt: "longbody, lowres, bad anatomy, bad hands, missing fingers, extra digit, fewer digits, cropped, worst quality, low quality",
num_samples: 1,
prompt: "Put furniture",
scale: 9,
seed: 3.5,
strength: 1
}
}
);
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=r8_1hf**********************************
This is your API token. Keep it to yourself.
import replicate
Run mohamad1998630/controlnet using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"mohamad1998630/controlnet:905298f5d96cb992b6133132b151d4029122599cfd57d7ceb4c4e447b2390855",
input={
"a_prompt": "best quality, extremely detailed",
"ddim_steps": 20,
"detect_resolution": 512,
"eta": 0,
"guess_mode": False,
"image_resolution": 512,
"input_image_path": "https://replicate.delivery/pbxt/KSbEAl9T5UeDInRBNViM9xIpyYR2XNcRVqXC8gKJeWSfNe1y/point3d-commercial-imaging-ltd-nQlVMCHPysY-unsplash.jpg",
"n_prompt": "longbody, lowres, bad anatomy, bad hands, missing fingers, extra digit, fewer digits, cropped, worst quality, low quality",
"num_samples": 1,
"prompt": "Put furniture",
"scale": 9,
"seed": 3.5,
"strength": 1
}
)
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=r8_1hf**********************************
This is your API token. Keep it to yourself.
Run mohamad1998630/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": "mohamad1998630/controlnet:905298f5d96cb992b6133132b151d4029122599cfd57d7ceb4c4e447b2390855",
"input": {
"a_prompt": "best quality, extremely detailed",
"ddim_steps": 20,
"detect_resolution": 512,
"eta": 0,
"guess_mode": false,
"image_resolution": 512,
"input_image_path": "https://replicate.delivery/pbxt/KSbEAl9T5UeDInRBNViM9xIpyYR2XNcRVqXC8gKJeWSfNe1y/point3d-commercial-imaging-ltd-nQlVMCHPysY-unsplash.jpg",
"n_prompt": "longbody, lowres, bad anatomy, bad hands, missing fingers, extra digit, fewer digits, cropped, worst quality, low quality",
"num_samples": 1,
"prompt": "Put furniture",
"scale": 9,
"seed": 3.5,
"strength": 1
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "elsb22zbvrv5nxstfzbzfrstpy",
"model": "mohamad1998630/controlnet",
"version": "905298f5d96cb992b6133132b151d4029122599cfd57d7ceb4c4e447b2390855",
"input": {
"a_prompt": "best quality, extremely detailed",
"ddim_steps": 20,
"detect_resolution": 512,
"eta": 0,
"guess_mode": false,
"image_resolution": 512,
"input_image_path": "https://replicate.delivery/pbxt/KSbEAl9T5UeDInRBNViM9xIpyYR2XNcRVqXC8gKJeWSfNe1y/point3d-commercial-imaging-ltd-nQlVMCHPysY-unsplash.jpg",
"n_prompt": "longbody, lowres, bad anatomy, bad hands, missing fingers, extra digit, fewer digits, cropped, worst quality, low quality",
"num_samples": 1,
"prompt": "Put furniture",
"scale": 9,
"seed": 3.5,
"strength": 1
},
"logs": "Image shape: (4480, 6720, 3)\n/src/annotator/uniformer/mmseg/models/segmentors/base.py:271: UserWarning: show==False and out_file is not specified, only result image will be returned\nwarnings.warn('show==False and out_file is not specified, only '\nGlobal seed set to 3\nData shape for DDIM sampling is (1, 4, 64, 96), eta 0.0\nRunning DDIM Sampling with 20 timesteps\nDDIM Sampler: 0%| | 0/20 [00:00<?, ?it/s]\nDDIM Sampler: 5%|▌ | 1/20 [00:01<00:30, 1.59s/it]\nDDIM Sampler: 10%|█ | 2/20 [00:02<00:26, 1.47s/it]\nDDIM Sampler: 15%|█▌ | 3/20 [00:04<00:24, 1.43s/it]\nDDIM Sampler: 20%|██ | 4/20 [00:05<00:22, 1.42s/it]\nDDIM Sampler: 25%|██▌ | 5/20 [00:07<00:21, 1.41s/it]\nDDIM Sampler: 30%|███ | 6/20 [00:08<00:19, 1.41s/it]\nDDIM Sampler: 35%|███▌ | 7/20 [00:09<00:18, 1.41s/it]\nDDIM Sampler: 40%|████ | 8/20 [00:11<00:16, 1.41s/it]\nDDIM Sampler: 45%|████▌ | 9/20 [00:12<00:15, 1.42s/it]\nDDIM Sampler: 50%|█████ | 10/20 [00:14<00:14, 1.42s/it]\nDDIM Sampler: 55%|█████▌ | 11/20 [00:15<00:12, 1.42s/it]\nDDIM Sampler: 60%|██████ | 12/20 [00:17<00:11, 1.43s/it]\nDDIM Sampler: 65%|██████▌ | 13/20 [00:18<00:10, 1.43s/it]\nDDIM Sampler: 70%|███████ | 14/20 [00:19<00:08, 1.43s/it]\nDDIM Sampler: 75%|███████▌ | 15/20 [00:21<00:07, 1.43s/it]\nDDIM Sampler: 80%|████████ | 16/20 [00:22<00:05, 1.43s/it]\nDDIM Sampler: 85%|████████▌ | 17/20 [00:24<00:04, 1.44s/it]\nDDIM Sampler: 90%|█████████ | 18/20 [00:25<00:02, 1.44s/it]\nDDIM Sampler: 95%|█████████▌| 19/20 [00:27<00:01, 1.45s/it]\nDDIM Sampler: 100%|██████████| 20/20 [00:28<00:00, 1.45s/it]\nDDIM Sampler: 100%|██████████| 20/20 [00:28<00:00, 1.43s/it]\n<class 'numpy.ndarray'>\n(512, 768, 3)",
"output": [
"https://storage.googleapis.com/replicate-files/PWpGmEAwYp50OddPlMXlUXKnekgZE78oqSucrfA7nFRqY8ZSA/out-0.png"
],
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2024-02-24T15:58:54.438733Z",
"started_at": "2024-02-24T16:06:31.466093Z",
"completed_at": "2024-02-24T16:07:06.767767Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/elsb22zbvrv5nxstfzbzfrstpy/cancel",
"get": "https://api.replicate.com/v1/predictions/elsb22zbvrv5nxstfzbzfrstpy"
},
"metrics": {
"predict_time": 35.301674,
"total_time": 492.329034
}
}