Skip to main content
POST
/
model
/
infer
/
flux
Generate images using Flux model
curl --request POST \
  --url https://http.flux.model-cluster.on-prem.clusters.yotta-uat.cluster.s9t.link/model/infer/flux \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "prompt": "Minimalist photography, beautiful mermaid with long hair covered with seashells and seagras, under water, sad face, heterochromia eyes blue and black, 8k, intricate detailed, eyes closed",
  "height": 1024,
  "width": 1024,
  "seed": 129232030,
  "num_inference_steps": 50,
  "num_images_per_prompt": 1,
  "guidance_scale": 7,
  "negative_prompt": "cartoon-like",
  "lora_weights": ""
}
'
import requests

url = "https://http.flux.model-cluster.on-prem.clusters.yotta-uat.cluster.s9t.link/model/infer/flux"

payload = {
"prompt": "Minimalist photography, beautiful mermaid with long hair covered with seashells and seagras, under water, sad face, heterochromia eyes blue and black, 8k, intricate detailed, eyes closed",
"height": 1024,
"width": 1024,
"seed": 129232030,
"num_inference_steps": 50,
"num_images_per_prompt": 1,
"guidance_scale": 7,
"negative_prompt": "cartoon-like",
"lora_weights": ""
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
prompt: 'Minimalist photography, beautiful mermaid with long hair covered with seashells and seagras, under water, sad face, heterochromia eyes blue and black, 8k, intricate detailed, eyes closed',
height: 1024,
width: 1024,
seed: 129232030,
num_inference_steps: 50,
num_images_per_prompt: 1,
guidance_scale: 7,
negative_prompt: 'cartoon-like',
lora_weights: ''
})
};

fetch('https://http.flux.model-cluster.on-prem.clusters.yotta-uat.cluster.s9t.link/model/infer/flux', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://http.flux.model-cluster.on-prem.clusters.yotta-uat.cluster.s9t.link/model/infer/flux",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'prompt' => 'Minimalist photography, beautiful mermaid with long hair covered with seashells and seagras, under water, sad face, heterochromia eyes blue and black, 8k, intricate detailed, eyes closed',
'height' => 1024,
'width' => 1024,
'seed' => 129232030,
'num_inference_steps' => 50,
'num_images_per_prompt' => 1,
'guidance_scale' => 7,
'negative_prompt' => 'cartoon-like',
'lora_weights' => ''
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://http.flux.model-cluster.on-prem.clusters.yotta-uat.cluster.s9t.link/model/infer/flux"

payload := strings.NewReader("{\n \"prompt\": \"Minimalist photography, beautiful mermaid with long hair covered with seashells and seagras, under water, sad face, heterochromia eyes blue and black, 8k, intricate detailed, eyes closed\",\n \"height\": 1024,\n \"width\": 1024,\n \"seed\": 129232030,\n \"num_inference_steps\": 50,\n \"num_images_per_prompt\": 1,\n \"guidance_scale\": 7,\n \"negative_prompt\": \"cartoon-like\",\n \"lora_weights\": \"\"\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://http.flux.model-cluster.on-prem.clusters.yotta-uat.cluster.s9t.link/model/infer/flux")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"prompt\": \"Minimalist photography, beautiful mermaid with long hair covered with seashells and seagras, under water, sad face, heterochromia eyes blue and black, 8k, intricate detailed, eyes closed\",\n \"height\": 1024,\n \"width\": 1024,\n \"seed\": 129232030,\n \"num_inference_steps\": 50,\n \"num_images_per_prompt\": 1,\n \"guidance_scale\": 7,\n \"negative_prompt\": \"cartoon-like\",\n \"lora_weights\": \"\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://http.flux.model-cluster.on-prem.clusters.yotta-uat.cluster.s9t.link/model/infer/flux")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"prompt\": \"Minimalist photography, beautiful mermaid with long hair covered with seashells and seagras, under water, sad face, heterochromia eyes blue and black, 8k, intricate detailed, eyes closed\",\n \"height\": 1024,\n \"width\": 1024,\n \"seed\": 129232030,\n \"num_inference_steps\": 50,\n \"num_images_per_prompt\": 1,\n \"guidance_scale\": 7,\n \"negative_prompt\": \"cartoon-like\",\n \"lora_weights\": \"\"\n}"

response = http.request(request)
puts response.read_body
{
  "images": [
    "aSDinaTvuI8gbWludGxpZnk="
  ],
  "time_taken": 123,
  "duration": 123,
  "seed": 123
}

Authorizations

Authorization
string
header
required

JWT token for authentication

Body

application/json
prompt
string
required

Text description of the image to generate

height
integer
default:1024

Height of the generated image in pixels

Required range: 256 <= x <= 1024
width
integer
default:1024

Width of the generated image in pixels

Required range: 256 <= x <= 1024
seed
integer

Random seed for reproducible generation

num_inference_steps
integer
default:50

Number of denoising steps

Required range: 1 <= x <= 150
num_images_per_prompt
integer
default:1

Number of images to generate

Required range: 1 <= x <= 4
guidance_scale
number
default:7

How closely to follow the prompt

Required range: 1 <= x <= 20
negative_prompt
string

Text description of what to avoid in the generated image

lora_weights
string
default:""

LoRA weights configuration

Response

Successful image generation

images
file[]
required

Array of generated images in base64 format

time_taken
number
required

Inference time in seconds

duration
number
required

Total processing time including queuing in seconds

seed
integer

The seed used for generation