typetext
{
"bottom": 0,
"image": "https://i.postimg.cc/vmY5BZP3/2024-04-16-21-30-59-9956.png",
"left": 400,
"negative_prompt": "ugly",
"output_format": "webp",
"output_quality": 80,
"prompt": "ice dragon, wings wide open",
"right": 400,
"top": 0
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_ebV**********************************
This is your API token. Keep it to yourself.
import Replicate from "replicate";
import fs from "node:fs";
const replicate = new Replicate({
auth: process.env.REPLICATE_API_TOKEN,
});
Run emaph/outpaint-controlnet-union using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"emaph/outpaint-controlnet-union:4d11bfa652f267e27f480471dd8d435cd92c2b99750644a0b38303d13946aae5",
{
input: {
bottom: 0,
image: "https://i.postimg.cc/vmY5BZP3/2024-04-16-21-30-59-9956.png",
left: 400,
negative_prompt: "ugly",
output_format: "webp",
output_quality: 80,
prompt: "ice dragon, wings wide open",
right: 400,
top: 0
}
}
);
// To access the file URL:
console.log(output[0].url()); //=> "http://example.com"
// To write the file to disk:
fs.writeFile("my-image.png", output[0]);
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_ebV**********************************
This is your API token. Keep it to yourself.
import replicate
Run emaph/outpaint-controlnet-union using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"emaph/outpaint-controlnet-union:4d11bfa652f267e27f480471dd8d435cd92c2b99750644a0b38303d13946aae5",
input={
"bottom": 0,
"image": "https://i.postimg.cc/vmY5BZP3/2024-04-16-21-30-59-9956.png",
"left": 400,
"negative_prompt": "ugly",
"output_format": "webp",
"output_quality": 80,
"prompt": "ice dragon, wings wide open",
"right": 400,
"top": 0
}
)
# To access the file URL:
print(output[0].url())
#=> "http://example.com"
# To write the file to disk:
with open("my-image.png", "wb") as file:
file.write(output[0].read())
To learn more, take a look at the guide on getting started with Python.
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_ebV**********************************
This is your API token. Keep it to yourself.
Run emaph/outpaint-controlnet-union 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": "emaph/outpaint-controlnet-union:4d11bfa652f267e27f480471dd8d435cd92c2b99750644a0b38303d13946aae5",
"input": {
"bottom": 0,
"image": "https://i.postimg.cc/vmY5BZP3/2024-04-16-21-30-59-9956.png",
"left": 400,
"negative_prompt": "ugly",
"output_format": "webp",
"output_quality": 80,
"prompt": "ice dragon, wings wide open",
"right": 400,
"top": 0
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "sbx0zj2vmnrgm0cgz5pt274q5g",
"model": "emaph/outpaint-controlnet-union",
"version": "4d11bfa652f267e27f480471dd8d435cd92c2b99750644a0b38303d13946aae5",
"input": {
"bottom": 0,
"image": "https://i.postimg.cc/vmY5BZP3/2024-04-16-21-30-59-9956.png",
"left": 400,
"negative_prompt": "ugly",
"output_format": "webp",
"output_quality": 80,
"prompt": "ice dragon, wings wide open",
"right": 400,
"top": 0
},
"logs": "Random seed set to: 2036446667\nChecking inputs\nDownloading https://i.postimg.cc/vmY5BZP3/2024-04-16-21-30-59-9956.png to /tmp/inputs/2024-04-16-21-30-59-9956.png\n✅ /tmp/inputs/2024-04-16-21-30-59-9956.png\n====================================\nChecking weights\n✅ diffusion_pytorch_model_promax.safetensors exists in ComfyUI/models/controlnet\n⏳ Downloading juggernautXL_v8Rundiffusion.safetensors to ComfyUI/models/checkpoints\n✅ juggernautXL_v8Rundiffusion.safetensors downloaded to ComfyUI/models/checkpoints in 16.15s, size: 6776.19MB\n====================================\nRunning workflow\ngot prompt\nExecuting node 4, title: Load Checkpoint, class type: CheckpointLoaderSimple\nmodel_type EPS\nUsing pytorch attention in VAE\nUsing pytorch attention in VAE\nloaded straight to GPU\nRequested to load SDXL\nLoading 1 new model\nExecuting node 6, title: Positive, class type: CLIPTextEncode\nRequested to load SDXLClipModel\nLoading 1 new model\nExecuting node 7, title: Negetive, class type: CLIPTextEncode\nExecuting node 16, title: Load ControlNet Model, class type: ControlNetLoader\nExecuting node 17, title: SetUnionControlNetType, class type: SetUnionControlNetType\nExecuting node 11, title: Load Image, class type: LoadImage\nExecuting node 10, title: Pad Image for Outpainting, class type: ImagePadForOutpaint\nExecuting node 48, title: InvertMask, class type: InvertMask\nExecuting node 47, title: Convert Mask to Image, class type: MaskToImage\nExecuting node 49, title: ImageCompositeMasked, class type: ImageCompositeMasked\nExecuting node 15, title: Apply ControlNet (Advanced), class type: ControlNetApplyAdvanced\nExecuting node 39, title: VAE Encode (for Inpainting), class type: VAEEncodeForInpaint\nRequested to load AutoencoderKL\nLoading 1 new model\nExecuting node 3, title: KSampler, class type: KSampler\nRequested to load ControlNet\nLoading 1 new model\n 0%| | 0/21 [00:00<?, ?it/s]\n 5%|▍ | 1/21 [00:00<00:08, 2.48it/s]\n 10%|▉ | 2/21 [00:00<00:06, 2.80it/s]\n 14%|█▍ | 3/21 [00:01<00:06, 2.93it/s]\n 19%|█▉ | 4/21 [00:01<00:05, 3.00it/s]\n 24%|██▍ | 5/21 [00:01<00:05, 3.03it/s]\n 29%|██▊ | 6/21 [00:02<00:04, 3.05it/s]\n 33%|███▎ | 7/21 [00:02<00:04, 3.07it/s]\n 38%|███▊ | 8/21 [00:02<00:04, 3.08it/s]\n 43%|████▎ | 9/21 [00:02<00:03, 3.08it/s]\n 48%|████▊ | 10/21 [00:03<00:03, 3.09it/s]\n 52%|█████▏ | 11/21 [00:03<00:03, 3.10it/s]\n 57%|█████▋ | 12/21 [00:03<00:02, 3.10it/s]\n 62%|██████▏ | 13/21 [00:04<00:02, 3.11it/s]\n 67%|██████▋ | 14/21 [00:04<00:02, 3.11it/s]\n 71%|███████▏ | 15/21 [00:04<00:01, 3.11it/s]\n 76%|███████▌ | 16/21 [00:05<00:01, 3.11it/s]\n 81%|████████ | 17/21 [00:05<00:01, 3.11it/s]\n 86%|████████▌ | 18/21 [00:05<00:00, 3.11it/s]\n 90%|█████████ | 19/21 [00:06<00:00, 3.11it/s]\n 95%|█████████▌| 20/21 [00:06<00:00, 3.11it/s]\n100%|██████████| 21/21 [00:06<00:00, 3.11it/s]\n100%|██████████| 21/21 [00:06<00:00, 3.07it/s]\nExecuting node 8, title: VAE Decode, class type: VAEDecode\nExecuting node 60, title: Save Image, class type: SaveImage\nPrompt executed in 13.26 seconds\noutputs: {'60': {'images': [{'filename': 'outpainted_00001_.png', 'subfolder': '', 'type': 'output'}]}}\n====================================\noutpainted_00001_.png",
"output": [
"https://replicate.delivery/pbxt/krjseJnglBxuaqpAv6G7j7J8xZbhzDHs6d2Gf0MQym2aNfZmA/outpainted_00001_.webp"
],
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2024-07-28T13:00:12.069Z",
"started_at": "2024-07-28T13:01:47.793943Z",
"completed_at": "2024-07-28T13:02:19.473227Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/sbx0zj2vmnrgm0cgz5pt274q5g/cancel",
"get": "https://api.replicate.com/v1/predictions/sbx0zj2vmnrgm0cgz5pt274q5g",
"web": "https://replicate.com/p/sbx0zj2vmnrgm0cgz5pt274q5g"
},
"metrics": {
"predict_time": 31.679283715,
"total_time": 127.404227
}
}