typetext
{
"cfg": 3.5,
"height": 1024,
"number_of_images": 1,
"output_format": "png",
"output_quality": 95,
"prompt": "a modern design ps5 controller with an orange fruit logo glowing with doodles all around",
"steps": 42,
"width": 1024
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_FOw**********************************
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 coder-pranav/image_better_text using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"coder-pranav/image_better_text:181d3b8f6dce10f4c5f11468066c4e3f537f78820d86317c48a37a9534996a37",
{
input: {
cfg: 3.5,
height: 1024,
number_of_images: 1,
output_format: "png",
output_quality: 95,
prompt: "a modern design ps5 controller with an orange fruit logo glowing with doodles all around",
steps: 42,
width: 1024
}
}
);
// 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_FOw**********************************
This is your API token. Keep it to yourself.
import replicate
Run coder-pranav/image_better_text using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"coder-pranav/image_better_text:181d3b8f6dce10f4c5f11468066c4e3f537f78820d86317c48a37a9534996a37",
input={
"cfg": 3.5,
"height": 1024,
"number_of_images": 1,
"output_format": "png",
"output_quality": 95,
"prompt": "a modern design ps5 controller with an orange fruit logo glowing with doodles all around",
"steps": 42,
"width": 1024
}
)
# 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_FOw**********************************
This is your API token. Keep it to yourself.
Run coder-pranav/image_better_text 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": "coder-pranav/image_better_text:181d3b8f6dce10f4c5f11468066c4e3f537f78820d86317c48a37a9534996a37",
"input": {
"cfg": 3.5,
"height": 1024,
"number_of_images": 1,
"output_format": "png",
"output_quality": 95,
"prompt": "a modern design ps5 controller with an orange fruit logo glowing with doodles all around",
"steps": 42,
"width": 1024
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "csk6sea8nhrj60cj8yrbfy1hym",
"model": "coder-pranav/image_better_text",
"version": "181d3b8f6dce10f4c5f11468066c4e3f537f78820d86317c48a37a9534996a37",
"input": {
"cfg": 3.5,
"height": 1024,
"number_of_images": 1,
"output_format": "png",
"output_quality": 95,
"prompt": "a modern design ps5 controller with an orange fruit logo glowing with doodles all around",
"steps": 42,
"width": 1024
},
"logs": "Random seed set to: 3138616841\nRunning workflow\n[ComfyUI] got prompt\nExecuting node 6, title: CLIP Text Encode (Positive Prompt), class type: CLIPTextEncode\nExecuting node 26, title: FluxGuidance, class type: FluxGuidance\nExecuting node 22, title: BasicGuider, class type: BasicGuider\nExecuting node 25, title: RandomNoise, class type: RandomNoise\nExecuting node 13, title: SamplerCustomAdvanced, class type: SamplerCustomAdvanced\n[ComfyUI]\n[ComfyUI] 0%| | 0/42 [00:00<?, ?it/s]\n[ComfyUI] 2%|▏ | 1/42 [00:00<00:08, 4.60it/s]\n[ComfyUI] 5%|▍ | 2/42 [00:00<00:13, 2.96it/s]\n[ComfyUI] 7%|▋ | 3/42 [00:01<00:14, 2.65it/s]\n[ComfyUI] 10%|▉ | 4/42 [00:01<00:15, 2.53it/s]\n[ComfyUI] 12%|█▏ | 5/42 [00:01<00:14, 2.47it/s]\n[ComfyUI] 14%|█▍ | 6/42 [00:02<00:14, 2.43it/s]\n[ComfyUI] 17%|█▋ | 7/42 [00:02<00:14, 2.40it/s]\n[ComfyUI] 19%|█▉ | 8/42 [00:03<00:14, 2.39it/s]\n[ComfyUI] 21%|██▏ | 9/42 [00:03<00:13, 2.38it/s]\n[ComfyUI] 24%|██▍ | 10/42 [00:04<00:13, 2.37it/s]\n[ComfyUI] 26%|██▌ | 11/42 [00:04<00:13, 2.37it/s]\n[ComfyUI] 29%|██▊ | 12/42 [00:04<00:12, 2.36it/s]\n[ComfyUI] 31%|███ | 13/42 [00:05<00:12, 2.36it/s]\n[ComfyUI] 33%|███▎ | 14/42 [00:05<00:11, 2.36it/s]\n[ComfyUI] 36%|███▌ | 15/42 [00:06<00:11, 2.36it/s]\n[ComfyUI] 38%|███▊ | 16/42 [00:06<00:11, 2.36it/s]\n[ComfyUI] 40%|████ | 17/42 [00:07<00:10, 2.36it/s]\n[ComfyUI] 43%|████▎ | 18/42 [00:07<00:10, 2.36it/s]\n[ComfyUI] 45%|████▌ | 19/42 [00:07<00:09, 2.35it/s]\n[ComfyUI] 48%|████▊ | 20/42 [00:08<00:09, 2.35it/s]\n[ComfyUI] 50%|█████ | 21/42 [00:08<00:08, 2.35it/s]\n[ComfyUI] 52%|█████▏ | 22/42 [00:09<00:08, 2.35it/s]\n[ComfyUI] 55%|█████▍ | 23/42 [00:09<00:08, 2.35it/s]\n[ComfyUI] 57%|█████▋ | 24/42 [00:09<00:07, 2.35it/s]\n[ComfyUI] 60%|█████▉ | 25/42 [00:10<00:07, 2.35it/s]\n[ComfyUI] 62%|██████▏ | 26/42 [00:10<00:06, 2.35it/s]\n[ComfyUI] 64%|██████▍ | 27/42 [00:11<00:06, 2.35it/s]\n[ComfyUI] 67%|██████▋ | 28/42 [00:11<00:05, 2.35it/s]\n[ComfyUI] 69%|██████▉ | 29/42 [00:12<00:05, 2.35it/s]\n[ComfyUI] 71%|███████▏ | 30/42 [00:12<00:05, 2.35it/s]\n[ComfyUI] 74%|███████▍ | 31/42 [00:12<00:04, 2.35it/s]\n[ComfyUI] 76%|███████▌ | 32/42 [00:13<00:04, 2.35it/s]\n[ComfyUI] 79%|███████▊ | 33/42 [00:13<00:03, 2.35it/s]\n[ComfyUI] 81%|████████ | 34/42 [00:14<00:03, 2.35it/s]\n[ComfyUI] 83%|████████▎ | 35/42 [00:14<00:02, 2.35it/s]\n[ComfyUI] 86%|████████▌ | 36/42 [00:15<00:02, 2.35it/s]\n[ComfyUI] 88%|████████▊ | 37/42 [00:15<00:02, 2.35it/s]\n[ComfyUI] 90%|█████████ | 38/42 [00:15<00:01, 2.35it/s]\n[ComfyUI] 93%|█████████▎| 39/42 [00:16<00:01, 2.35it/s]\n[ComfyUI] 95%|█████████▌| 40/42 [00:16<00:00, 2.35it/s]\n[ComfyUI] 98%|█████████▊| 41/42 [00:17<00:00, 2.35it/s]\n[ComfyUI] 100%|██████████| 42/42 [00:17<00:00, 2.35it/s]\n[ComfyUI] 100%|██████████| 42/42 [00:17<00:00, 2.38it/s]\nExecuting node 8, title: VAE Decode, class type: VAEDecode\nExecuting node 9, title: Save Image, class type: SaveImage\n[ComfyUI] Prompt executed in 18.32 seconds\noutputs: {'9': {'images': [{'filename': 'ComfyUI_00001_.png', 'subfolder': '', 'type': 'output'}]}}\n====================================\nComfyUI_00001_.png",
"output": [
"https://replicate.delivery/yhqm/jwVGfv9BTyTGUi7ceYdUtWHUh4zxHfWtB0RSxHVwbagzowEnA/ComfyUI_00001_.png"
],
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2024-10-01T10:46:28.268Z",
"started_at": "2024-10-01T10:46:28.276737Z",
"completed_at": "2024-10-01T10:46:49.87369Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/csk6sea8nhrj60cj8yrbfy1hym/cancel",
"get": "https://api.replicate.com/v1/predictions/csk6sea8nhrj60cj8yrbfy1hym",
"web": "https://replicate.com/p/csk6sea8nhrj60cj8yrbfy1hym"
},
"metrics": {
"predict_time": 21.596952842,
"total_time": 21.60569
}
}