typefile
{
"context_encoder": "SeeCoder",
"control": "https://replicate.delivery/pbxt/IvpLP71kyA7Zz7BiLnjoskVpbCHnaflLHVMa6DNQWwvacF9u/astronautridinghouse-canny.png",
"control_net": "canny",
"guidance_scale": 2,
"image": "https://replicate.delivery/pbxt/IvpLPCeH4QTQomgDkJy4NHla7zk2lSz4Tdv6f9x6vywCsMTs/astronautridinghouse-input.jpg",
"num_inference_steps": 50,
"out_height": 512,
"out_width": 768,
"preprocess_type": "canny",
"tag_diffuser": "Deliberate-v2.0"
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_Gc8**********************************
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 cjwbw/prompt-free-diffusion using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"cjwbw/prompt-free-diffusion:8ffe43fe7298a95554ea24047fb144b921ca1a85f661527b34b2c02b2573579f",
{
input: {
context_encoder: "SeeCoder",
control: "https://replicate.delivery/pbxt/IvpLP71kyA7Zz7BiLnjoskVpbCHnaflLHVMa6DNQWwvacF9u/astronautridinghouse-canny.png",
control_net: "canny",
guidance_scale: 2,
image: "https://replicate.delivery/pbxt/IvpLPCeH4QTQomgDkJy4NHla7zk2lSz4Tdv6f9x6vywCsMTs/astronautridinghouse-input.jpg",
num_inference_steps: 50,
out_height: 512,
out_width: 768,
preprocess_type: "canny",
tag_diffuser: "Deliberate-v2.0"
}
}
);
// To access the file URL:
console.log(output.url()); //=> "http://example.com"
// To write the file to disk:
fs.writeFile("my-image.png", 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_Gc8**********************************
This is your API token. Keep it to yourself.
import replicate
Run cjwbw/prompt-free-diffusion using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"cjwbw/prompt-free-diffusion:8ffe43fe7298a95554ea24047fb144b921ca1a85f661527b34b2c02b2573579f",
input={
"context_encoder": "SeeCoder",
"control": "https://replicate.delivery/pbxt/IvpLP71kyA7Zz7BiLnjoskVpbCHnaflLHVMa6DNQWwvacF9u/astronautridinghouse-canny.png",
"control_net": "canny",
"guidance_scale": 2,
"image": "https://replicate.delivery/pbxt/IvpLPCeH4QTQomgDkJy4NHla7zk2lSz4Tdv6f9x6vywCsMTs/astronautridinghouse-input.jpg",
"num_inference_steps": 50,
"out_height": 512,
"out_width": 768,
"preprocess_type": "canny",
"tag_diffuser": "Deliberate-v2.0"
}
)
# To access the file URL:
print(output.url())
#=> "http://example.com"
# To write the file to disk:
with open("my-image.png", "wb") as file:
file.write(output.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_Gc8**********************************
This is your API token. Keep it to yourself.
Run cjwbw/prompt-free-diffusion 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": "cjwbw/prompt-free-diffusion:8ffe43fe7298a95554ea24047fb144b921ca1a85f661527b34b2c02b2573579f",
"input": {
"context_encoder": "SeeCoder",
"control": "https://replicate.delivery/pbxt/IvpLP71kyA7Zz7BiLnjoskVpbCHnaflLHVMa6DNQWwvacF9u/astronautridinghouse-canny.png",
"control_net": "canny",
"guidance_scale": 2,
"image": "https://replicate.delivery/pbxt/IvpLPCeH4QTQomgDkJy4NHla7zk2lSz4Tdv6f9x6vywCsMTs/astronautridinghouse-input.jpg",
"num_inference_steps": 50,
"out_height": 512,
"out_width": 768,
"preprocess_type": "canny",
"tag_diffuser": "Deliberate-v2.0"
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "65vmcz4r3jb35lsulawxcx56r4",
"model": "cjwbw/prompt-free-diffusion",
"version": "8ffe43fe7298a95554ea24047fb144b921ca1a85f661527b34b2c02b2573579f",
"input": {
"context_encoder": "SeeCoder",
"control": "https://replicate.delivery/pbxt/IvpLP71kyA7Zz7BiLnjoskVpbCHnaflLHVMa6DNQWwvacF9u/astronautridinghouse-canny.png",
"control_net": "canny",
"guidance_scale": 2,
"image": "https://replicate.delivery/pbxt/IvpLPCeH4QTQomgDkJy4NHla7zk2lSz4Tdv6f9x6vywCsMTs/astronautridinghouse-input.jpg",
"num_inference_steps": 50,
"out_height": 512,
"out_width": 768,
"preprocess_type": "canny",
"tag_diffuser": "Deliberate-v2.0"
},
"logs": "Using seed: 12119\n#######################\n# Running in eps mode #\n#######################\nmaking attention of type 'vanilla' with 512 in_channels\nWorking with z of shape (1, 4, 32, 32) = 4096 dimensions.\nmaking attention of type 'vanilla' with 512 in_channels\nLoad model from [pretrained/pfd/vae/sd-v2-0-base-autokl.pth] strict [True].\nLoad autoencoderkl with total 83653863 parameters,79145.299 parameter sum.\nLoad swin with total 195201204 parameters,44522.425 parameter sum.\nLoad seecoder_decoder with total 27783168 parameters,13929.608 parameter sum.\nLoad seecoder_query_transformer with total 71130624 parameters,21163.731 parameter sum.\nLoad seecoder with total 294114996 parameters,79615.763 parameter sum.\nLoad openai_unet_2d_next with total 859520964 parameters,100102.951 parameter sum.\nLoad controlnet with total 361279120 parameters,41433.391 parameter sum.\nLoad pfd_with_control with total 1598568943 parameters,300297.405 parameter sum.\nLoad context encoder from [pretrained/pfd/seecoder/seecoder-v1-0.safetensors] strict [True].\nLoad diffuser from [pretrained/pfd/diffuser/Deliberate-v2-0.safetensors] strict [True].\nLoad controlnet from [pretrained/controlnet/control_sd15_canny_slimmed.safetensors] strict [True].\n###################\n# Running in FP16 #\n###################\nData shape for DDIM sampling is [1, 4, 64, 96], eta 0.0\nDDIM Sampler: 0%| | 0/50 [00:00<?, ?it/s]\nDDIM Sampler: 2%|▏ | 1/50 [00:00<00:33, 1.44it/s]\nDDIM Sampler: 4%|▍ | 2/50 [00:01<00:27, 1.73it/s]\nDDIM Sampler: 6%|▌ | 3/50 [00:01<00:25, 1.85it/s]\nDDIM Sampler: 8%|▊ | 4/50 [00:02<00:24, 1.92it/s]\nDDIM Sampler: 10%|█ | 5/50 [00:02<00:23, 1.95it/s]\nDDIM Sampler: 12%|█▏ | 6/50 [00:03<00:22, 1.97it/s]\nDDIM Sampler: 14%|█▍ | 7/50 [00:03<00:21, 1.98it/s]\nDDIM Sampler: 16%|█▌ | 8/50 [00:04<00:21, 1.99it/s]\nDDIM Sampler: 18%|█▊ | 9/50 [00:04<00:20, 2.00it/s]\nDDIM Sampler: 20%|██ | 10/50 [00:05<00:19, 2.00it/s]\nDDIM Sampler: 22%|██▏ | 11/50 [00:05<00:19, 2.00it/s]\nDDIM Sampler: 24%|██▍ | 12/50 [00:06<00:18, 2.01it/s]\nDDIM Sampler: 26%|██▌ | 13/50 [00:06<00:18, 2.01it/s]\nDDIM Sampler: 28%|██▊ | 14/50 [00:07<00:17, 2.01it/s]\nDDIM Sampler: 30%|███ | 15/50 [00:07<00:17, 2.01it/s]\nDDIM Sampler: 32%|███▏ | 16/50 [00:08<00:16, 2.01it/s]\nDDIM Sampler: 34%|███▍ | 17/50 [00:08<00:16, 2.00it/s]\nDDIM Sampler: 36%|███▌ | 18/50 [00:09<00:15, 2.00it/s]\nDDIM Sampler: 38%|███▊ | 19/50 [00:09<00:15, 2.01it/s]\nDDIM Sampler: 40%|████ | 20/50 [00:10<00:14, 2.01it/s]\nDDIM Sampler: 42%|████▏ | 21/50 [00:10<00:14, 2.01it/s]\nDDIM Sampler: 44%|████▍ | 22/50 [00:11<00:13, 2.01it/s]\nDDIM Sampler: 46%|████▌ | 23/50 [00:11<00:13, 2.01it/s]\nDDIM Sampler: 48%|████▊ | 24/50 [00:12<00:12, 2.01it/s]\nDDIM Sampler: 50%|█████ | 25/50 [00:12<00:12, 2.00it/s]\nDDIM Sampler: 52%|█████▏ | 26/50 [00:13<00:11, 2.00it/s]\nDDIM Sampler: 54%|█████▍ | 27/50 [00:13<00:11, 2.01it/s]\nDDIM Sampler: 56%|█████▌ | 28/50 [00:14<00:10, 2.00it/s]\nDDIM Sampler: 58%|█████▊ | 29/50 [00:14<00:10, 2.00it/s]\nDDIM Sampler: 60%|██████ | 30/50 [00:15<00:09, 2.00it/s]\nDDIM Sampler: 62%|██████▏ | 31/50 [00:15<00:09, 2.00it/s]\nDDIM Sampler: 64%|██████▍ | 32/50 [00:16<00:08, 2.00it/s]\nDDIM Sampler: 66%|██████▌ | 33/50 [00:16<00:08, 2.00it/s]\nDDIM Sampler: 68%|██████▊ | 34/50 [00:17<00:07, 2.00it/s]\nDDIM Sampler: 70%|███████ | 35/50 [00:17<00:07, 2.00it/s]\nDDIM Sampler: 72%|███████▏ | 36/50 [00:18<00:06, 2.01it/s]\nDDIM Sampler: 74%|███████▍ | 37/50 [00:18<00:06, 2.01it/s]\nDDIM Sampler: 76%|███████▌ | 38/50 [00:19<00:05, 2.01it/s]\nDDIM Sampler: 78%|███████▊ | 39/50 [00:19<00:05, 2.00it/s]\nDDIM Sampler: 80%|████████ | 40/50 [00:20<00:04, 2.00it/s]\nDDIM Sampler: 82%|████████▏ | 41/50 [00:20<00:04, 2.00it/s]\nDDIM Sampler: 84%|████████▍ | 42/50 [00:21<00:03, 2.00it/s]\nDDIM Sampler: 86%|████████▌ | 43/50 [00:21<00:03, 2.00it/s]\nDDIM Sampler: 88%|████████▊ | 44/50 [00:22<00:02, 2.00it/s]\nDDIM Sampler: 90%|█████████ | 45/50 [00:22<00:02, 2.00it/s]\nDDIM Sampler: 92%|█████████▏| 46/50 [00:23<00:01, 2.00it/s]\nDDIM Sampler: 94%|█████████▍| 47/50 [00:23<00:01, 2.00it/s]\nDDIM Sampler: 96%|█████████▌| 48/50 [00:24<00:01, 2.00it/s]\nDDIM Sampler: 98%|█████████▊| 49/50 [00:24<00:00, 2.00it/s]\nDDIM Sampler: 100%|██████████| 50/50 [00:25<00:00, 2.00it/s]\nDDIM Sampler: 100%|██████████| 50/50 [00:25<00:00, 1.99it/s]",
"output": "https://replicate.delivery/pbxt/J3nCFqcUvg4dD92f7KoduC9hZ0qhzntY9QBTrIygypcvMfBRA/out.png",
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2023-06-02T18:16:12.52868Z",
"started_at": "2023-06-02T18:25:13.938578Z",
"completed_at": "2023-06-02T18:26:39.60045Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/65vmcz4r3jb35lsulawxcx56r4/cancel",
"get": "https://api.replicate.com/v1/predictions/65vmcz4r3jb35lsulawxcx56r4"
},
"metrics": {
"predict_time": 85.661872,
"total_time": 627.07177
}
}

