Flux Schnell
Text to image with in-house optimised Flux Schnell base model.
Tip
- Generate v3 with Flux is currenly available on dedicated servers.
- Test servers are available at $1/hour price. You can generate as many images as you like during this time.
- Python
- JavaScript
- PHP
import requests
import json
url = "https://api.imagepipeline.io/generate/v3"
headers = {
"API-Key": "Your API Key"
}
data = {
"prompt": "High end wildlife photography, beautiful colourful toucan sitting on a tree branch, trending on artstation",
"width": 1024,
"height": 1024,
"server_id": "your-server-id"
}
response = requests.post(url, headers=headers, json=data)
print(response.json())
const url = "https://api.imagepipeline.io/generate/v3";
const headers = {
"API-Key": "Your API Key",
"Content-Type": "application/json"
};
const data = {
"prompt": "High end wildlife photography, beautiful colourful toucan sitting on a tree branch, trending on artstation",
"width": 1024,
"height": 1024,
"server_id": "your-server-id"
};
fetch(url, {
method: "POST",
headers: headers,
body: JSON.stringify(data)
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
<?php
$url = "https://api.imagepipeline.io/generate/v3";
$headers = array(
"API-Key: Your API Key",
"Content-Type: application/json"
);
$data = array(
"prompt" => "High end wildlife photography, beautiful colourful toucan sitting on a tree branch, trending on artstation",
"width" => 1024,
"height" => 1024,
"server_id"=> "your-server-id"
);
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
$response = curl_exec($ch);
if($response === FALSE){
die(curl_error($ch));
}
$responseData = json_decode($response, TRUE);
curl_close($ch);
var_dump($responseData);
?>
Available JSON Parameters for Control
Parameter | Type | Notes |
---|---|---|
prompt | string | required. The prompt text for generating the image. |
negative_prompt | string | Optional. The negative prompt to influence the image generation. |
num_inference_steps | integer | Default: 20. Number of inference steps. |
samples | integer | Max: 4. Default: 2. Number of image samples to generate. |
height | integer | Max: 1536. Default: 1024. Height of the image. |
width | integer | Max: 1536. Default: 1024. Width of the image. |
seed | integer | Default: -1. Controlling the seed can help you generate reproducible images. |
direct_link | boolean | Fetches the friendly URL in PNG format. |
server_id | string | Optional. Provide a server ID to use an enterprise subscription or for load-balancing. |
webhook | string | URL to send the generated image to. |
batch_id | string | Adds a batch ID for the image generation request. |
file_prefix | string | Adds a prefix to the generated files. |
queued_image_urls | boolean | Returns the links of the images prematurely. The link will have the image once the task is run successfully. |
Status
Your response will include a status
.
- If the
status
=SUCCESS
, you will also havedownload_urls
that will have the links to your generated image based on the number of samples you have entered. The maximum number of samples that can be generated is 4. - If the
status
=PENDING
, you will receive aid
. You can use the status endpoint to fetch your image using theid
. - If the
status
=FAILURE
, you will receive only an error message.
Endpoint: [GET]
https://api.imagepipeline.io/generate/v3/status/{{id}}
Pass the API-Key as the authorization in the header.