typetext
{
"aspect_ratio": "1:1",
"extra_lora_scale": 1,
"guidance_scale": 3.5,
"lora_scale": 1,
"model": "dev",
"num_inference_steps": 28,
"num_outputs": 4,
"output_format": "jpg",
"output_quality": 100,
"prompt": "A handrawn sketch in the style of EXCALIDRAW shows a computer operating system with title text “LLM OS” . The sketch is divided into sections, each with a different function of the operating system. The sections include keyboard shortcuts, game controller, and a summary of the operating system. The drawing is done in a cartoon style, making it visually appealing and easy to understand.",
"prompt_strength": 0.8
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_1cB**********************************
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 justmalhar/flux-excalidraw using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"justmalhar/flux-excalidraw:f854fe3a91032428d4a0d3717cba6314887a6f248cbd1568e58eb424d69bf994",
{
input: {
aspect_ratio: "1:1",
extra_lora_scale: 1,
guidance_scale: 3.5,
lora_scale: 1,
model: "dev",
num_inference_steps: 28,
num_outputs: 4,
output_format: "jpg",
output_quality: 100,
prompt: "A handrawn sketch in the style of EXCALIDRAW shows a computer operating system with title text “LLM OS” . The sketch is divided into sections, each with a different function of the operating system. The sections include keyboard shortcuts, game controller, and a summary of the operating system. The drawing is done in a cartoon style, making it visually appealing and easy to understand.",
prompt_strength: 0.8
}
}
);
// 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_1cB**********************************
This is your API token. Keep it to yourself.
import replicate
Run justmalhar/flux-excalidraw using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"justmalhar/flux-excalidraw:f854fe3a91032428d4a0d3717cba6314887a6f248cbd1568e58eb424d69bf994",
input={
"aspect_ratio": "1:1",
"extra_lora_scale": 1,
"guidance_scale": 3.5,
"lora_scale": 1,
"model": "dev",
"num_inference_steps": 28,
"num_outputs": 4,
"output_format": "jpg",
"output_quality": 100,
"prompt": "A handrawn sketch in the style of EXCALIDRAW shows a computer operating system with title text “LLM OS” . The sketch is divided into sections, each with a different function of the operating system. The sections include keyboard shortcuts, game controller, and a summary of the operating system. The drawing is done in a cartoon style, making it visually appealing and easy to understand.",
"prompt_strength": 0.8
}
)
# 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_1cB**********************************
This is your API token. Keep it to yourself.
Run justmalhar/flux-excalidraw 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": "justmalhar/flux-excalidraw:f854fe3a91032428d4a0d3717cba6314887a6f248cbd1568e58eb424d69bf994",
"input": {
"aspect_ratio": "1:1",
"extra_lora_scale": 1,
"guidance_scale": 3.5,
"lora_scale": 1,
"model": "dev",
"num_inference_steps": 28,
"num_outputs": 4,
"output_format": "jpg",
"output_quality": 100,
"prompt": "A handrawn sketch in the style of EXCALIDRAW shows a computer operating system with title text “LLM OS” . The sketch is divided into sections, each with a different function of the operating system. The sections include keyboard shortcuts, game controller, and a summary of the operating system. The drawing is done in a cartoon style, making it visually appealing and easy to understand.",
"prompt_strength": 0.8
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "nkjksndwc9rj60cj6z5v5q901r",
"model": "justmalhar/flux-excalidraw",
"version": "f854fe3a91032428d4a0d3717cba6314887a6f248cbd1568e58eb424d69bf994",
"input": {
"aspect_ratio": "1:1",
"extra_lora_scale": 1,
"guidance_scale": 3.5,
"lora_scale": 1,
"model": "dev",
"num_inference_steps": 28,
"num_outputs": 4,
"output_format": "jpg",
"output_quality": 100,
"prompt": "A handrawn sketch in the style of EXCALIDRAW shows a computer operating system with title text “LLM OS” . The sketch is divided into sections, each with a different function of the operating system. The sections include keyboard shortcuts, game controller, and a summary of the operating system. The drawing is done in a cartoon style, making it visually appealing and easy to understand.",
"prompt_strength": 0.8
},
"logs": "Using seed: 1485\nPrompt: A handrawn sketch in the style of EXCALIDRAW shows a computer operating system with title text “LLM OS” . The sketch is divided into sections, each with a different function of the operating system. The sections include keyboard shortcuts, game controller, and a summary of the operating system. The drawing is done in a cartoon style, making it visually appealing and easy to understand.\n[!] txt2img mode\nUsing dev model\nfree=4626895077376\nDownloading weights\n2024-09-28T08:42:33Z | INFO | [ Initiating ] chunk_size=150M dest=/tmp/tmp7x32phfa/weights url=https://replicate.delivery/yhqm/0D8yaMZoPV5bGd9qo3djWuYFP5UUX4HK97sbnb538hZDyV4E/trained_model.tar\n2024-09-28T08:42:36Z | INFO | [ Complete ] dest=/tmp/tmp7x32phfa/weights size=\"430 MB\" total_elapsed=2.934s url=https://replicate.delivery/yhqm/0D8yaMZoPV5bGd9qo3djWuYFP5UUX4HK97sbnb538hZDyV4E/trained_model.tar\nDownloaded weights in 2.97s\nLoaded LoRAs in 3.84s\n 0%| | 0/28 [00:00<?, ?it/s]\n 4%|▎ | 1/28 [00:02<01:07, 2.48s/it]\n 7%|▋ | 2/28 [00:04<00:57, 2.20s/it]\n 11%|█ | 3/28 [00:06<00:58, 2.33s/it]\n 14%|█▍ | 4/28 [00:09<00:57, 2.39s/it]\n 18%|█▊ | 5/28 [00:11<00:55, 2.43s/it]\n 21%|██▏ | 6/28 [00:14<00:53, 2.45s/it]\n 25%|██▌ | 7/28 [00:16<00:51, 2.46s/it]\n 29%|██▊ | 8/28 [00:19<00:49, 2.47s/it]\n 32%|███▏ | 9/28 [00:21<00:47, 2.48s/it]\n 36%|███▌ | 10/28 [00:24<00:44, 2.48s/it]\n 39%|███▉ | 11/28 [00:26<00:42, 2.48s/it]\n 43%|████▎ | 12/28 [00:29<00:39, 2.49s/it]\n 46%|████▋ | 13/28 [00:31<00:37, 2.49s/it]\n 50%|█████ | 14/28 [00:34<00:34, 2.49s/it]\n 54%|█████▎ | 15/28 [00:36<00:32, 2.49s/it]\n 57%|█████▋ | 16/28 [00:39<00:29, 2.49s/it]\n 61%|██████ | 17/28 [00:41<00:27, 2.49s/it]\n 64%|██████▍ | 18/28 [00:44<00:24, 2.49s/it]\n 68%|██████▊ | 19/28 [00:46<00:22, 2.49s/it]\n 71%|███████▏ | 20/28 [00:49<00:19, 2.49s/it]\n 75%|███████▌ | 21/28 [00:51<00:17, 2.49s/it]\n 79%|███████▊ | 22/28 [00:54<00:14, 2.50s/it]\n 82%|████████▏ | 23/28 [00:56<00:12, 2.50s/it]\n 86%|████████▌ | 24/28 [00:59<00:09, 2.50s/it]\n 89%|████████▉ | 25/28 [01:01<00:07, 2.50s/it]\n 93%|█████████▎| 26/28 [01:04<00:04, 2.50s/it]\n 96%|█████████▋| 27/28 [01:06<00:02, 2.50s/it]\n100%|██████████| 28/28 [01:09<00:00, 2.50s/it]\n100%|██████████| 28/28 [01:09<00:00, 2.47s/it]",
"output": [
"https://replicate.delivery/yhqm/Wguk1h2oDMLBDFjxTR2GMi1ZxHKuFVSJckcALR375qCxzV4E/out-0.jpg",
"https://replicate.delivery/yhqm/KeOEflX6y7oFmEXzhe3E4jwH21GHkeayIXOtTHQNgMRR8cFOB/out-1.jpg",
"https://replicate.delivery/yhqm/wf3uhhI14lXfP0eCl6701RNUqgyEZTiEVvA1sOEg39eT8cFOB/out-2.jpg",
"https://replicate.delivery/yhqm/fA5nMwo7D8UvT6DKuolJHbCf7mT8BAbR01B76vjAhRgEPXhTA/out-3.jpg"
],
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2024-09-28T08:42:31.906Z",
"started_at": "2024-09-28T08:42:33.600752Z",
"completed_at": "2024-09-28T08:43:49.001092Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/nkjksndwc9rj60cj6z5v5q901r/cancel",
"get": "https://api.replicate.com/v1/predictions/nkjksndwc9rj60cj6z5v5q901r",
"web": "https://replicate.com/p/nkjksndwc9rj60cj6z5v5q901r"
},
"metrics": {
"predict_time": 75.400339734,
"total_time": 77.095092
}
}


