typetext
{
"aspect_ratio": "16:9",
"extra_lora_scale": 1,
"go_fast": true,
"guidance_scale": 3.5,
"lora_scale": 1,
"megapixels": "1",
"model": "schnell",
"num_inference_steps": 4,
"num_outputs": 1,
"output_format": "webp",
"output_quality": 80,
"prompt": "A scene from the video game Monkey Island depicting a grand pirate ship in the ocean",
"prompt_strength": 0.8
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_QVM**********************************
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 andreasjansson/flux-monkey-island using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"andreasjansson/flux-monkey-island:fb6d34e863c81b27705f413933bf14429163a2654181835a9e8bf3bf3a7025fe",
{
input: {
aspect_ratio: "16:9",
extra_lora_scale: 1,
go_fast: true,
guidance_scale: 3.5,
lora_scale: 1,
megapixels: "1",
model: "schnell",
num_inference_steps: 4,
num_outputs: 1,
output_format: "webp",
output_quality: 80,
prompt: "A scene from the video game Monkey Island depicting a grand pirate ship in the ocean",
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_QVM**********************************
This is your API token. Keep it to yourself.
import replicate
Run andreasjansson/flux-monkey-island using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"andreasjansson/flux-monkey-island:fb6d34e863c81b27705f413933bf14429163a2654181835a9e8bf3bf3a7025fe",
input={
"aspect_ratio": "16:9",
"extra_lora_scale": 1,
"go_fast": True,
"guidance_scale": 3.5,
"lora_scale": 1,
"megapixels": "1",
"model": "schnell",
"num_inference_steps": 4,
"num_outputs": 1,
"output_format": "webp",
"output_quality": 80,
"prompt": "A scene from the video game Monkey Island depicting a grand pirate ship in the ocean",
"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_QVM**********************************
This is your API token. Keep it to yourself.
Run andreasjansson/flux-monkey-island 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": "andreasjansson/flux-monkey-island:fb6d34e863c81b27705f413933bf14429163a2654181835a9e8bf3bf3a7025fe",
"input": {
"aspect_ratio": "16:9",
"extra_lora_scale": 1,
"go_fast": true,
"guidance_scale": 3.5,
"lora_scale": 1,
"megapixels": "1",
"model": "schnell",
"num_inference_steps": 4,
"num_outputs": 1,
"output_format": "webp",
"output_quality": 80,
"prompt": "A scene from the video game Monkey Island depicting a grand pirate ship in the ocean",
"prompt_strength": 0.8
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "rve1cvwfh1rmc0ckk2vsh21yj8",
"model": "andreasjansson/flux-monkey-island",
"version": "fb6d34e863c81b27705f413933bf14429163a2654181835a9e8bf3bf3a7025fe",
"input": {
"aspect_ratio": "16:9",
"extra_lora_scale": 1,
"go_fast": true,
"guidance_scale": 3.5,
"lora_scale": 1,
"megapixels": "1",
"model": "schnell",
"num_inference_steps": 4,
"num_outputs": 1,
"output_format": "webp",
"output_quality": 80,
"prompt": "A scene from the video game Monkey Island depicting a grand pirate ship in the ocean",
"prompt_strength": 0.8
},
"logs": "Lora https://replicate.delivery/yhqm/eqoFdeiVsjnST0gOCJCLrWmjuycl51Lf4p5e1r50ouwPPtLNB/trained_model.tar already loaded\nrunning quantized prediction\nUsing seed: 3585702239\n 0%| | 0/4 [00:00<?, ?it/s]\n 50%|█████ | 2/4 [00:00<00:00, 18.77it/s]\n100%|██████████| 4/4 [00:00<00:00, 13.57it/s]\n100%|██████████| 4/4 [00:00<00:00, 14.15it/s]\nTotal safe images: 1 out of 1",
"output": [
"https://replicate.delivery/xezq/xjcf3liCUeq74UpefrAALRwZsBQUh3dHLfXAQN7CdJf6gMf7JA/out-0.webp"
],
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2024-12-05T21:26:26.952Z",
"started_at": "2024-12-05T21:26:26.959982Z",
"completed_at": "2024-12-05T21:26:27.537372Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/rve1cvwfh1rmc0ckk2vsh21yj8/cancel",
"get": "https://api.replicate.com/v1/predictions/rve1cvwfh1rmc0ckk2vsh21yj8",
"stream": "https://stream.replicate.com/v1/files/bcwr-4jkoyffwxgspzpwnaj62rdagq6xglcvrm24tzlvlpy6rg3ewofva",
"web": "https://replicate.com/p/rve1cvwfh1rmc0ckk2vsh21yj8"
},
"metrics": {
"predict_time": 0.577389991,
"total_time": 0.585372
}
}