typetext
{
"aspect_ratio": "1:1",
"guidance": 4.5,
"input_images": [
"https://replicate.delivery/pbxt/O8muUX89JrCvKCFhSK8LzroggccsICUqm3IcI2RhMIYUAU52/santa-face.webp",
"https://replicate.delivery/pbxt/O8muV2jRyTkfI22g0rjmnNzfjpafFPGTsry6bv55Ur3qZLDN/santa-suit.webp",
"https://replicate.delivery/pbxt/O8muUwVSfmOuCTmbvqkYNRllEamm6jURvo9mQX0QnEc3o5ZW/server%20room.webp",
"https://replicate.delivery/pbxt/O8muUQwC9QcXYYnphpgJjDlchGP5tMnC6VGbJVaeeppx0JUA/wooden-nutcracker.webp",
"https://replicate.delivery/pbxt/O8muVNs8yyw2mRYBRAThpeCroRtRh6GcuY5ORMMB7dzmOsHj/elf-robot.webp",
"https://replicate.delivery/pbxt/O8muVK8RVsOjcH4uDtCfsVcsZ7bPMRhTE9Zy55wjUBO7P4fi/glass-christmas-tree.webp",
"https://replicate.delivery/pbxt/O8muUfKKQEwAMBME77QX1UrWssPowqbBKAF0BP6txDjBBYzw/nutcracker-hologram.webp",
"https://replicate.delivery/pbxt/O8muUvd2wJSGNL7BTH48NpNVYxEmt0xQZs83WE3UuegX5tUQ/precision-laser-soldering-tool.webp",
"https://replicate.delivery/pbxt/O8muUWazRTLxoYaihgZVz6HGSm8UBF1KCIxJc62ljN5oj4Gi/quantum-power-core.webp",
"https://replicate.delivery/pbxt/O8muUhtzSHyCciC2vwR6gZ6UqC0sOouF1OJI8fRjUUbKfZ30/rustic-cabin.webp"
],
"output_format": "webp",
"output_quality": 100,
"prompt": "<Scene>A high-tech workshop blending a rustic North Pole cabin with a futuristic server room. The left side is warm with a christmas tree made of glass in front of fireplace, while the right side is cold glowing server racks with nutcracker toy in server shelf and quantum powercore in front of server rack.</Scene>\n<Subjects>Santa Claus wearing a hydraulic exoskeleton suit and AR goggles. He is using a precision laser soldering tool in his right hand, to repair a vintage wooden nutcracker. A small floating green robotic elf drone hovers over his shoulder, assisting with the repair. The blue hologram of the nutcracker appearing on his AR glass.</Subjects>\n<Lighting>A dramatic split-lighting scheme. Warm orange firelight from rustic cabin illuminates Santa's left side, while the cool electric blue glow from a quantum power core and holographic hologram displays lights up his right side, and reddish hue light up his face from his precision laser soldering tool to fix the nutrcacker.</Lighting>\n<Style>Cinematic sci-fi realism with festive holiday elements. Highly detailed textures, contrasting the rough wood against sleek hologram glass and metal.</Style>\n<Camera>Medium shot, eye-level, 35mm lens, shallow depth of field focusing on Santa's work and the nutcracker.</Camera>",
"prompt_upsampling": false,
"resolution": "4 MP",
"safety_tolerance": 2,
"steps": 50
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_073**********************************
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 black-forest-labs/flux-2-flex using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const input = {
aspect_ratio: "1:1",
guidance: 4.5,
input_images: ["https://replicate.delivery/pbxt/O8muUX89JrCvKCFhSK8LzroggccsICUqm3IcI2RhMIYUAU52/santa-face.webp","https://replicate.delivery/pbxt/O8muV2jRyTkfI22g0rjmnNzfjpafFPGTsry6bv55Ur3qZLDN/santa-suit.webp","https://replicate.delivery/pbxt/O8muUwVSfmOuCTmbvqkYNRllEamm6jURvo9mQX0QnEc3o5ZW/server%20room.webp","https://replicate.delivery/pbxt/O8muUQwC9QcXYYnphpgJjDlchGP5tMnC6VGbJVaeeppx0JUA/wooden-nutcracker.webp","https://replicate.delivery/pbxt/O8muVNs8yyw2mRYBRAThpeCroRtRh6GcuY5ORMMB7dzmOsHj/elf-robot.webp","https://replicate.delivery/pbxt/O8muVK8RVsOjcH4uDtCfsVcsZ7bPMRhTE9Zy55wjUBO7P4fi/glass-christmas-tree.webp","https://replicate.delivery/pbxt/O8muUfKKQEwAMBME77QX1UrWssPowqbBKAF0BP6txDjBBYzw/nutcracker-hologram.webp","https://replicate.delivery/pbxt/O8muUvd2wJSGNL7BTH48NpNVYxEmt0xQZs83WE3UuegX5tUQ/precision-laser-soldering-tool.webp","https://replicate.delivery/pbxt/O8muUWazRTLxoYaihgZVz6HGSm8UBF1KCIxJc62ljN5oj4Gi/quantum-power-core.webp","https://replicate.delivery/pbxt/O8muUhtzSHyCciC2vwR6gZ6UqC0sOouF1OJI8fRjUUbKfZ30/rustic-cabin.webp"],
output_format: "webp",
output_quality: 100,
prompt: "<Scene>A high-tech workshop blending a rustic North Pole cabin with a futuristic server room. The left side is warm with a christmas tree made of glass in front of fireplace, while the right side is cold glowing server racks with nutcracker toy in server shelf and quantum powercore in front of server rack.</Scene>\n<Subjects>Santa Claus wearing a hydraulic exoskeleton suit and AR goggles. He is using a precision laser soldering tool in his right hand, to repair a vintage wooden nutcracker. A small floating green robotic elf drone hovers over his shoulder, assisting with the repair. The blue hologram of the nutcracker appearing on his AR glass.</Subjects>\n<Lighting>A dramatic split-lighting scheme. Warm orange firelight from rustic cabin illuminates Santa's left side, while the cool electric blue glow from a quantum power core and holographic hologram displays lights up his right side, and reddish hue light up his face from his precision laser soldering tool to fix the nutrcacker.</Lighting>\n<Style>Cinematic sci-fi realism with festive holiday elements. Highly detailed textures, contrasting the rough wood against sleek hologram glass and metal.</Style>\n<Camera>Medium shot, eye-level, 35mm lens, shallow depth of field focusing on Santa's work and the nutcracker.</Camera>",
prompt_upsampling: false,
resolution: "4 MP",
safety_tolerance: 2,
steps: 50
};
const output = await replicate.run("black-forest-labs/flux-2-flex", { input });
// 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_073**********************************
This is your API token. Keep it to yourself.
import replicate
Run black-forest-labs/flux-2-flex using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"black-forest-labs/flux-2-flex",
input={
"aspect_ratio": "1:1",
"guidance": 4.5,
"input_images": ["https://replicate.delivery/pbxt/O8muUX89JrCvKCFhSK8LzroggccsICUqm3IcI2RhMIYUAU52/santa-face.webp","https://replicate.delivery/pbxt/O8muV2jRyTkfI22g0rjmnNzfjpafFPGTsry6bv55Ur3qZLDN/santa-suit.webp","https://replicate.delivery/pbxt/O8muUwVSfmOuCTmbvqkYNRllEamm6jURvo9mQX0QnEc3o5ZW/server%20room.webp","https://replicate.delivery/pbxt/O8muUQwC9QcXYYnphpgJjDlchGP5tMnC6VGbJVaeeppx0JUA/wooden-nutcracker.webp","https://replicate.delivery/pbxt/O8muVNs8yyw2mRYBRAThpeCroRtRh6GcuY5ORMMB7dzmOsHj/elf-robot.webp","https://replicate.delivery/pbxt/O8muVK8RVsOjcH4uDtCfsVcsZ7bPMRhTE9Zy55wjUBO7P4fi/glass-christmas-tree.webp","https://replicate.delivery/pbxt/O8muUfKKQEwAMBME77QX1UrWssPowqbBKAF0BP6txDjBBYzw/nutcracker-hologram.webp","https://replicate.delivery/pbxt/O8muUvd2wJSGNL7BTH48NpNVYxEmt0xQZs83WE3UuegX5tUQ/precision-laser-soldering-tool.webp","https://replicate.delivery/pbxt/O8muUWazRTLxoYaihgZVz6HGSm8UBF1KCIxJc62ljN5oj4Gi/quantum-power-core.webp","https://replicate.delivery/pbxt/O8muUhtzSHyCciC2vwR6gZ6UqC0sOouF1OJI8fRjUUbKfZ30/rustic-cabin.webp"],
"output_format": "webp",
"output_quality": 100,
"prompt": "<Scene>A high-tech workshop blending a rustic North Pole cabin with a futuristic server room. The left side is warm with a christmas tree made of glass in front of fireplace, while the right side is cold glowing server racks with nutcracker toy in server shelf and quantum powercore in front of server rack.</Scene>\n<Subjects>Santa Claus wearing a hydraulic exoskeleton suit and AR goggles. He is using a precision laser soldering tool in his right hand, to repair a vintage wooden nutcracker. A small floating green robotic elf drone hovers over his shoulder, assisting with the repair. The blue hologram of the nutcracker appearing on his AR glass.</Subjects>\n<Lighting>A dramatic split-lighting scheme. Warm orange firelight from rustic cabin illuminates Santa's left side, while the cool electric blue glow from a quantum power core and holographic hologram displays lights up his right side, and reddish hue light up his face from his precision laser soldering tool to fix the nutrcacker.</Lighting>\n<Style>Cinematic sci-fi realism with festive holiday elements. Highly detailed textures, contrasting the rough wood against sleek hologram glass and metal.</Style>\n<Camera>Medium shot, eye-level, 35mm lens, shallow depth of field focusing on Santa's work and the nutcracker.</Camera>",
"prompt_upsampling": False,
"resolution": "4 MP",
"safety_tolerance": 2,
"steps": 50
}
)
# 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_073**********************************
This is your API token. Keep it to yourself.
Run black-forest-labs/flux-2-flex 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 $'{
"input": {
"aspect_ratio": "1:1",
"guidance": 4.5,
"input_images": ["https://replicate.delivery/pbxt/O8muUX89JrCvKCFhSK8LzroggccsICUqm3IcI2RhMIYUAU52/santa-face.webp","https://replicate.delivery/pbxt/O8muV2jRyTkfI22g0rjmnNzfjpafFPGTsry6bv55Ur3qZLDN/santa-suit.webp","https://replicate.delivery/pbxt/O8muUwVSfmOuCTmbvqkYNRllEamm6jURvo9mQX0QnEc3o5ZW/server%20room.webp","https://replicate.delivery/pbxt/O8muUQwC9QcXYYnphpgJjDlchGP5tMnC6VGbJVaeeppx0JUA/wooden-nutcracker.webp","https://replicate.delivery/pbxt/O8muVNs8yyw2mRYBRAThpeCroRtRh6GcuY5ORMMB7dzmOsHj/elf-robot.webp","https://replicate.delivery/pbxt/O8muVK8RVsOjcH4uDtCfsVcsZ7bPMRhTE9Zy55wjUBO7P4fi/glass-christmas-tree.webp","https://replicate.delivery/pbxt/O8muUfKKQEwAMBME77QX1UrWssPowqbBKAF0BP6txDjBBYzw/nutcracker-hologram.webp","https://replicate.delivery/pbxt/O8muUvd2wJSGNL7BTH48NpNVYxEmt0xQZs83WE3UuegX5tUQ/precision-laser-soldering-tool.webp","https://replicate.delivery/pbxt/O8muUWazRTLxoYaihgZVz6HGSm8UBF1KCIxJc62ljN5oj4Gi/quantum-power-core.webp","https://replicate.delivery/pbxt/O8muUhtzSHyCciC2vwR6gZ6UqC0sOouF1OJI8fRjUUbKfZ30/rustic-cabin.webp"],
"output_format": "webp",
"output_quality": 100,
"prompt": "<Scene>A high-tech workshop blending a rustic North Pole cabin with a futuristic server room. The left side is warm with a christmas tree made of glass in front of fireplace, while the right side is cold glowing server racks with nutcracker toy in server shelf and quantum powercore in front of server rack.</Scene>\\n<Subjects>Santa Claus wearing a hydraulic exoskeleton suit and AR goggles. He is using a precision laser soldering tool in his right hand, to repair a vintage wooden nutcracker. A small floating green robotic elf drone hovers over his shoulder, assisting with the repair. The blue hologram of the nutcracker appearing on his AR glass.</Subjects>\\n<Lighting>A dramatic split-lighting scheme. Warm orange firelight from rustic cabin illuminates Santa\'s left side, while the cool electric blue glow from a quantum power core and holographic hologram displays lights up his right side, and reddish hue light up his face from his precision laser soldering tool to fix the nutrcacker.</Lighting>\\n<Style>Cinematic sci-fi realism with festive holiday elements. Highly detailed textures, contrasting the rough wood against sleek hologram glass and metal.</Style>\\n<Camera>Medium shot, eye-level, 35mm lens, shallow depth of field focusing on Santa\'s work and the nutcracker.</Camera>",
"prompt_upsampling": false,
"resolution": "4 MP",
"safety_tolerance": 2,
"steps": 50
}
}' \
https://api.replicate.com/v1/models/black-forest-labs/flux-2-flex/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "833ef9av15rma0cts9y8rca1mg",
"model": "black-forest-labs/flux-2-flex",
"version": "hidden",
"input": {
"aspect_ratio": "1:1",
"guidance": 4.5,
"input_images": [
"https://replicate.delivery/pbxt/O8muUX89JrCvKCFhSK8LzroggccsICUqm3IcI2RhMIYUAU52/santa-face.webp",
"https://replicate.delivery/pbxt/O8muV2jRyTkfI22g0rjmnNzfjpafFPGTsry6bv55Ur3qZLDN/santa-suit.webp",
"https://replicate.delivery/pbxt/O8muUwVSfmOuCTmbvqkYNRllEamm6jURvo9mQX0QnEc3o5ZW/server%20room.webp",
"https://replicate.delivery/pbxt/O8muUQwC9QcXYYnphpgJjDlchGP5tMnC6VGbJVaeeppx0JUA/wooden-nutcracker.webp",
"https://replicate.delivery/pbxt/O8muVNs8yyw2mRYBRAThpeCroRtRh6GcuY5ORMMB7dzmOsHj/elf-robot.webp",
"https://replicate.delivery/pbxt/O8muVK8RVsOjcH4uDtCfsVcsZ7bPMRhTE9Zy55wjUBO7P4fi/glass-christmas-tree.webp",
"https://replicate.delivery/pbxt/O8muUfKKQEwAMBME77QX1UrWssPowqbBKAF0BP6txDjBBYzw/nutcracker-hologram.webp",
"https://replicate.delivery/pbxt/O8muUvd2wJSGNL7BTH48NpNVYxEmt0xQZs83WE3UuegX5tUQ/precision-laser-soldering-tool.webp",
"https://replicate.delivery/pbxt/O8muUWazRTLxoYaihgZVz6HGSm8UBF1KCIxJc62ljN5oj4Gi/quantum-power-core.webp",
"https://replicate.delivery/pbxt/O8muUhtzSHyCciC2vwR6gZ6UqC0sOouF1OJI8fRjUUbKfZ30/rustic-cabin.webp"
],
"output_format": "webp",
"output_quality": 100,
"prompt": "<Scene>A high-tech workshop blending a rustic North Pole cabin with a futuristic server room. The left side is warm with a christmas tree made of glass in front of fireplace, while the right side is cold glowing server racks with nutcracker toy in server shelf and quantum powercore in front of server rack.</Scene>\n<Subjects>Santa Claus wearing a hydraulic exoskeleton suit and AR goggles. He is using a precision laser soldering tool in his right hand, to repair a vintage wooden nutcracker. A small floating green robotic elf drone hovers over his shoulder, assisting with the repair. The blue hologram of the nutcracker appearing on his AR glass.</Subjects>\n<Lighting>A dramatic split-lighting scheme. Warm orange firelight from rustic cabin illuminates Santa's left side, while the cool electric blue glow from a quantum power core and holographic hologram displays lights up his right side, and reddish hue light up his face from his precision laser soldering tool to fix the nutrcacker.</Lighting>\n<Style>Cinematic sci-fi realism with festive holiday elements. Highly detailed textures, contrasting the rough wood against sleek hologram glass and metal.</Style>\n<Camera>Medium shot, eye-level, 35mm lens, shallow depth of field focusing on Santa's work and the nutcracker.</Camera>",
"prompt_upsampling": false,
"resolution": "4 MP",
"safety_tolerance": 2,
"steps": 50
},
"logs": "Running prediction...\nUsing 4 MP resolution: 2016x2016\nUsing seed: 52520\nProcessing input image\nResizing input image to 1440px\nImage size: 595.9KB\nProcessing input image\nResizing input image to 1440px\nImage size: 177.3KB\nProcessing input image\nResizing input image to 1440px\nImage size: 243.9KB\nProcessing input image\nResizing input image to 1440px\nImage size: 264.3KB\nProcessing input image\nResizing input image to 1440px\nImage size: 108.4KB\nProcessing input image\nResizing input image to 1440px\nImage size: 294.6KB\nProcessing input image\nResizing input image to 1440px\nImage size: 329.3KB\nProcessing input image\nResizing input image to 1440px\nImage size: 93.2KB\nProcessing input image\nResizing input image to 1440px\nImage size: 232.0KB\nProcessing input image\nResizing input image to 1440px\nImage size: 300.4KB\nGenerating image...\nCurrent status: {'id': '365ba203-5b00-4aea-a894-72be445525eb', 'status': 'Pending', 'result': None, 'progress': None, 'details': None, 'preview': None}\nCurrent status: {'id': '365ba203-5b00-4aea-a894-72be445525eb', 'status': 'Pending', 'result': None, 'progress': None, 'details': None, 'preview': None}\nCurrent status: {'id': '365ba203-5b00-4aea-a894-72be445525eb', 'status': 'Pending', 'result': None, 'progress': None, 'details': None, 'preview': None}\nCurrent status: {'id': '365ba203-5b00-4aea-a894-72be445525eb', 'status': 'Pending', 'result': None, 'progress': None, 'details': None, 'preview': None}\nCurrent status: {'id': '365ba203-5b00-4aea-a894-72be445525eb', 'status': 'Pending', 'result': None, 'progress': None, 'details': None, 'preview': None}\nCurrent status: {'id': '365ba203-5b00-4aea-a894-72be445525eb', 'status': 'Pending', 'result': None, 'progress': None, 'details': None, 'preview': None}\nCurrent status: {'id': '365ba203-5b00-4aea-a894-72be445525eb', 'status': 'Pending', 'result': None, 'progress': None, 'details': None, 'preview': None}\nCurrent status: {'id': '365ba203-5b00-4aea-a894-72be445525eb', 'status': 'Pending', 'result': None, 'progress': None, 'details': None, 'preview': None}\nCurrent status: {'id': '365ba203-5b00-4aea-a894-72be445525eb', 'status': 'Pending', 'result': None, 'progress': None, 'details': None, 'preview': None}\nCurrent status: {'id': '365ba203-5b00-4aea-a894-72be445525eb', 'status': 'Pending', 'result': None, 'progress': None, 'details': None, 'preview': None}\nCurrent status: {'id': '365ba203-5b00-4aea-a894-72be445525eb', 'status': 'Pending', 'result': None, 'progress': None, 'details': None, 'preview': None}\nCurrent status: {'id': '365ba203-5b00-4aea-a894-72be445525eb', 'status': 'Pending', 'result': None, 'progress': None, 'details': None, 'preview': None}\nCurrent status: {'id': '365ba203-5b00-4aea-a894-72be445525eb', 'status': 'Pending', 'result': None, 'progress': None, 'details': None, 'preview': None}\nCurrent status: {'id': '365ba203-5b00-4aea-a894-72be445525eb', 'status': 'Pending', 'result': None, 'progress': None, 'details': None, 'preview': None}\nCurrent status: {'id': '365ba203-5b00-4aea-a894-72be445525eb', 'status': 'Pending', 'result': None, 'progress': None, 'details': None, 'preview': None}\nCurrent status: {'id': '365ba203-5b00-4aea-a894-72be445525eb', 'status': 'Pending', 'result': None, 'progress': None, 'details': None, 'preview': None}\nCurrent status: {'id': '365ba203-5b00-4aea-a894-72be445525eb', 'status': 'Pending', 'result': None, 'progress': None, 'details': None, 'preview': None}\nCurrent status: {'id': '365ba203-5b00-4aea-a894-72be445525eb', 'status': 'Pending', 'result': None, 'progress': None, 'details': None, 'preview': None}\nCurrent status: {'id': '365ba203-5b00-4aea-a894-72be445525eb', 'status': 'Pending', 'result': None, 'progress': None, 'details': None, 'preview': None}\nCurrent status: {'id': '365ba203-5b00-4aea-a894-72be445525eb', 'status': 'Pending', 'result': None, 'progress': None, 'details': None, 'preview': None}\nCurrent status: {'id': '365ba203-5b00-4aea-a894-72be445525eb', 'status': 'Pending', 'result': None, 'progress': None, 'details': None, 'preview': None}\nCurrent status: {'id': '365ba203-5b00-4aea-a894-72be445525eb', 'status': 'Pending', 'result': None, 'progress': None, 'details': None, 'preview': None}\nCurrent status: {'id': '365ba203-5b00-4aea-a894-72be445525eb', 'status': 'Pending', 'result': None, 'progress': None, 'details': None, 'preview': None}\nCurrent status: {'id': '365ba203-5b00-4aea-a894-72be445525eb', 'status': 'Pending', 'result': None, 'progress': None, 'details': None, 'preview': None}\nCurrent status: {'id': '365ba203-5b00-4aea-a894-72be445525eb', 'status': 'Pending', 'result': None, 'progress': None, 'details': None, 'preview': None}\nGenerated image in 267.5sec\nDownloaded image in 0.57sec",
"output": "https://replicate.delivery/xezq/tno52MC5gC5nHR4SXf1SlmforZE0khMuc0iqBwfV0GMzdpbrA/tmpcefzrd0w.webp",
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2025-11-28T12:42:18.761Z",
"started_at": "2025-11-28T12:42:18.776132Z",
"completed_at": "2025-11-28T12:46:49.92005Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/833ef9av15rma0cts9y8rca1mg/cancel",
"get": "https://api.replicate.com/v1/predictions/833ef9av15rma0cts9y8rca1mg",
"stream": "https://stream.replicate.com/v1/files/bcwr-sihb3rivvzmmn5giqt5fqlpcexpx3nbd53tfkx6kgojkfi5zozaq",
"web": "https://replicate.com/p/833ef9av15rma0cts9y8rca1mg"
},
"metrics": {
"predict_time": 271.143917731,
"total_time": 271.159050394
}
}









