typetext
{
"aspect_ratio": "1:1",
"extra_lora_scale": 1,
"guidance_scale": 3.5,
"height": 1156,
"lora_scale": 1,
"model": "dev",
"num_inference_steps": 25,
"num_outputs": 1,
"output_format": "png",
"output_quality": 100,
"prompt": "Autumn. A new Twist",
"prompt_strength": 0.8,
"width": 856
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_Dj5**********************************
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 bingbangboom-lab/flux-new-whimscape using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"bingbangboom-lab/flux-new-whimscape:2e8de10f217bc56da163a0204cf09f89995eaf643459014803fae79753183682",
{
input: {
aspect_ratio: "1:1",
extra_lora_scale: 1,
guidance_scale: 3.5,
height: 1156,
lora_scale: 1,
model: "dev",
num_inference_steps: 25,
num_outputs: 1,
output_format: "png",
output_quality: 100,
prompt: "Autumn. A new Twist",
prompt_strength: 0.8,
width: 856
}
}
);
// 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_Dj5**********************************
This is your API token. Keep it to yourself.
import replicate
Run bingbangboom-lab/flux-new-whimscape using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"bingbangboom-lab/flux-new-whimscape:2e8de10f217bc56da163a0204cf09f89995eaf643459014803fae79753183682",
input={
"aspect_ratio": "1:1",
"extra_lora_scale": 1,
"guidance_scale": 3.5,
"height": 1156,
"lora_scale": 1,
"model": "dev",
"num_inference_steps": 25,
"num_outputs": 1,
"output_format": "png",
"output_quality": 100,
"prompt": "Autumn. A new Twist",
"prompt_strength": 0.8,
"width": 856
}
)
# 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_Dj5**********************************
This is your API token. Keep it to yourself.
Run bingbangboom-lab/flux-new-whimscape 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": "bingbangboom-lab/flux-new-whimscape:2e8de10f217bc56da163a0204cf09f89995eaf643459014803fae79753183682",
"input": {
"aspect_ratio": "1:1",
"extra_lora_scale": 1,
"guidance_scale": 3.5,
"height": 1156,
"lora_scale": 1,
"model": "dev",
"num_inference_steps": 25,
"num_outputs": 1,
"output_format": "png",
"output_quality": 100,
"prompt": "Autumn. A new Twist",
"prompt_strength": 0.8,
"width": 856
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "yy4rdygj4drm40cj373ta9v0a4",
"model": "bingbangboom-lab/flux-new-whimscape",
"version": "2e8de10f217bc56da163a0204cf09f89995eaf643459014803fae79753183682",
"input": {
"aspect_ratio": "1:1",
"extra_lora_scale": 1,
"guidance_scale": 3.5,
"height": 1156,
"lora_scale": 1,
"model": "dev",
"num_inference_steps": 25,
"num_outputs": 1,
"output_format": "png",
"output_quality": 100,
"prompt": "Autumn. A new Twist",
"prompt_strength": 0.8,
"width": 856
},
"logs": "Using seed: 54655\nPrompt: Autumn. A new Twist\n[!] txt2img mode\nUsing dev model\nLoaded LoRAs in 8.23s\n 0%| | 0/25 [00:00<?, ?it/s]\n 4%|▍ | 1/25 [00:00<00:06, 3.52it/s]\n 8%|▊ | 2/25 [00:00<00:05, 3.98it/s]\n 12%|█▏ | 3/25 [00:00<00:05, 3.76it/s]\n 16%|█▌ | 4/25 [00:01<00:05, 3.66it/s]\n 20%|██ | 5/25 [00:01<00:05, 3.61it/s]\n 24%|██▍ | 6/25 [00:01<00:05, 3.58it/s]\n 28%|██▊ | 7/25 [00:01<00:05, 3.56it/s]\n 32%|███▏ | 8/25 [00:02<00:04, 3.55it/s]\n 36%|███▌ | 9/25 [00:02<00:04, 3.54it/s]\n 40%|████ | 10/25 [00:02<00:04, 3.53it/s]\n 44%|████▍ | 11/25 [00:03<00:03, 3.53it/s]\n 48%|████▊ | 12/25 [00:03<00:03, 3.53it/s]\n 52%|█████▏ | 13/25 [00:03<00:03, 3.53it/s]\n 56%|█████▌ | 14/25 [00:03<00:03, 3.53it/s]\n 60%|██████ | 15/25 [00:04<00:02, 3.53it/s]\n 64%|██████▍ | 16/25 [00:04<00:02, 3.52it/s]\n 68%|██████▊ | 17/25 [00:04<00:02, 3.52it/s]\n 72%|███████▏ | 18/25 [00:05<00:01, 3.52it/s]\n 76%|███████▌ | 19/25 [00:05<00:01, 3.52it/s]\n 80%|████████ | 20/25 [00:05<00:01, 3.52it/s]\n 84%|████████▍ | 21/25 [00:05<00:01, 3.52it/s]\n 88%|████████▊ | 22/25 [00:06<00:00, 3.52it/s]\n 92%|█████████▏| 23/25 [00:06<00:00, 3.52it/s]\n 96%|█████████▌| 24/25 [00:06<00:00, 3.52it/s]\n100%|██████████| 25/25 [00:07<00:00, 3.52it/s]\n100%|██████████| 25/25 [00:07<00:00, 3.55it/s]",
"output": [
"https://replicate.delivery/yhqm/K7smLTaUTQ7CBJarIl429Q1slwG7Q4SIMJ5OtgqBhRaQE33E/out-0.png"
],
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2024-09-22T12:48:49.699Z",
"started_at": "2024-09-22T12:48:49.707907Z",
"completed_at": "2024-09-22T12:49:05.912292Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/yy4rdygj4drm40cj373ta9v0a4/cancel",
"get": "https://api.replicate.com/v1/predictions/yy4rdygj4drm40cj373ta9v0a4",
"web": "https://replicate.com/p/yy4rdygj4drm40cj373ta9v0a4"
},
"metrics": {
"predict_time": 16.204384846,
"total_time": 16.213292
}
}