curl --request POST \
--url https://api.tokenfactory.nebius.com/v1/images/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "<string>",
"prompt": "<string>",
"loras": {
"scale": 1,
"url": "https://civitai.com/api/download/models/244808?type=Model&format=SafeTensor"
},
"width": 512,
"height": 512,
"num_inference_steps": 40,
"seed": -1,
"guidance_scale": 50,
"negative_prompt": "",
"response_extension": "webp",
"response_format": "url"
}
'import requests
url = "https://api.tokenfactory.nebius.com/v1/images/generations"
payload = {
"model": "<string>",
"prompt": "<string>",
"loras": {
"scale": 1,
"url": "https://civitai.com/api/download/models/244808?type=Model&format=SafeTensor"
},
"width": 512,
"height": 512,
"num_inference_steps": 40,
"seed": -1,
"guidance_scale": 50,
"negative_prompt": "",
"response_extension": "webp",
"response_format": "url"
}
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({
model: '<string>',
prompt: '<string>',
loras: {
scale: 1,
url: 'https://civitai.com/api/download/models/244808?type=Model&format=SafeTensor'
},
width: 512,
height: 512,
num_inference_steps: 40,
seed: -1,
guidance_scale: 50,
negative_prompt: '',
response_extension: 'webp',
response_format: 'url'
})
};
fetch('https://api.tokenfactory.nebius.com/v1/images/generations', 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://api.tokenfactory.nebius.com/v1/images/generations",
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([
'model' => '<string>',
'prompt' => '<string>',
'loras' => [
'scale' => 1,
'url' => 'https://civitai.com/api/download/models/244808?type=Model&format=SafeTensor'
],
'width' => 512,
'height' => 512,
'num_inference_steps' => 40,
'seed' => -1,
'guidance_scale' => 50,
'negative_prompt' => '',
'response_extension' => 'webp',
'response_format' => 'url'
]),
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://api.tokenfactory.nebius.com/v1/images/generations"
payload := strings.NewReader("{\n \"model\": \"<string>\",\n \"prompt\": \"<string>\",\n \"loras\": {\n \"scale\": 1,\n \"url\": \"https://civitai.com/api/download/models/244808?type=Model&format=SafeTensor\"\n },\n \"width\": 512,\n \"height\": 512,\n \"num_inference_steps\": 40,\n \"seed\": -1,\n \"guidance_scale\": 50,\n \"negative_prompt\": \"\",\n \"response_extension\": \"webp\",\n \"response_format\": \"url\"\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://api.tokenfactory.nebius.com/v1/images/generations")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"<string>\",\n \"prompt\": \"<string>\",\n \"loras\": {\n \"scale\": 1,\n \"url\": \"https://civitai.com/api/download/models/244808?type=Model&format=SafeTensor\"\n },\n \"width\": 512,\n \"height\": 512,\n \"num_inference_steps\": 40,\n \"seed\": -1,\n \"guidance_scale\": 50,\n \"negative_prompt\": \"\",\n \"response_extension\": \"webp\",\n \"response_format\": \"url\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tokenfactory.nebius.com/v1/images/generations")
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 \"model\": \"<string>\",\n \"prompt\": \"<string>\",\n \"loras\": {\n \"scale\": 1,\n \"url\": \"https://civitai.com/api/download/models/244808?type=Model&format=SafeTensor\"\n },\n \"width\": 512,\n \"height\": 512,\n \"num_inference_steps\": 40,\n \"seed\": -1,\n \"guidance_scale\": 50,\n \"negative_prompt\": \"\",\n \"response_extension\": \"webp\",\n \"response_format\": \"url\"\n}"
response = http.request(request)
puts response.read_body{
"data": [
{
"b64_json": "<string>",
"url": "<string>"
}
],
"id": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Generate
curl --request POST \
--url https://api.tokenfactory.nebius.com/v1/images/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "<string>",
"prompt": "<string>",
"loras": {
"scale": 1,
"url": "https://civitai.com/api/download/models/244808?type=Model&format=SafeTensor"
},
"width": 512,
"height": 512,
"num_inference_steps": 40,
"seed": -1,
"guidance_scale": 50,
"negative_prompt": "",
"response_extension": "webp",
"response_format": "url"
}
'import requests
url = "https://api.tokenfactory.nebius.com/v1/images/generations"
payload = {
"model": "<string>",
"prompt": "<string>",
"loras": {
"scale": 1,
"url": "https://civitai.com/api/download/models/244808?type=Model&format=SafeTensor"
},
"width": 512,
"height": 512,
"num_inference_steps": 40,
"seed": -1,
"guidance_scale": 50,
"negative_prompt": "",
"response_extension": "webp",
"response_format": "url"
}
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({
model: '<string>',
prompt: '<string>',
loras: {
scale: 1,
url: 'https://civitai.com/api/download/models/244808?type=Model&format=SafeTensor'
},
width: 512,
height: 512,
num_inference_steps: 40,
seed: -1,
guidance_scale: 50,
negative_prompt: '',
response_extension: 'webp',
response_format: 'url'
})
};
fetch('https://api.tokenfactory.nebius.com/v1/images/generations', 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://api.tokenfactory.nebius.com/v1/images/generations",
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([
'model' => '<string>',
'prompt' => '<string>',
'loras' => [
'scale' => 1,
'url' => 'https://civitai.com/api/download/models/244808?type=Model&format=SafeTensor'
],
'width' => 512,
'height' => 512,
'num_inference_steps' => 40,
'seed' => -1,
'guidance_scale' => 50,
'negative_prompt' => '',
'response_extension' => 'webp',
'response_format' => 'url'
]),
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://api.tokenfactory.nebius.com/v1/images/generations"
payload := strings.NewReader("{\n \"model\": \"<string>\",\n \"prompt\": \"<string>\",\n \"loras\": {\n \"scale\": 1,\n \"url\": \"https://civitai.com/api/download/models/244808?type=Model&format=SafeTensor\"\n },\n \"width\": 512,\n \"height\": 512,\n \"num_inference_steps\": 40,\n \"seed\": -1,\n \"guidance_scale\": 50,\n \"negative_prompt\": \"\",\n \"response_extension\": \"webp\",\n \"response_format\": \"url\"\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://api.tokenfactory.nebius.com/v1/images/generations")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"<string>\",\n \"prompt\": \"<string>\",\n \"loras\": {\n \"scale\": 1,\n \"url\": \"https://civitai.com/api/download/models/244808?type=Model&format=SafeTensor\"\n },\n \"width\": 512,\n \"height\": 512,\n \"num_inference_steps\": 40,\n \"seed\": -1,\n \"guidance_scale\": 50,\n \"negative_prompt\": \"\",\n \"response_extension\": \"webp\",\n \"response_format\": \"url\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tokenfactory.nebius.com/v1/images/generations")
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 \"model\": \"<string>\",\n \"prompt\": \"<string>\",\n \"loras\": {\n \"scale\": 1,\n \"url\": \"https://civitai.com/api/download/models/244808?type=Model&format=SafeTensor\"\n },\n \"width\": 512,\n \"height\": 512,\n \"num_inference_steps\": 40,\n \"seed\": -1,\n \"guidance_scale\": 50,\n \"negative_prompt\": \"\",\n \"response_extension\": \"webp\",\n \"response_format\": \"url\"\n}"
response = http.request(request)
puts response.read_body{
"data": [
{
"b64_json": "<string>",
"url": "<string>"
}
],
"id": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Query Parameters
current project ID
Body
ID of the model to use.
"black-forest-labs/flux-schnell"
A text description of the desired image(s).
1 - 2000List of publicly accessible LoRAs compatible with the selected model
1 - 10 elementsShow child attributes
Show child attributes
{
"scale": 1,
"url": "https://civitai.com/api/download/models/244808?type=Model&format=SafeTensor"
}
The width of the generated image(s) in pixels.
64 <= x <= 2048The height of the generated image(s) in pixels.
64 <= x <= 2048Number of denoising steps in the diffusion process. Higher values generally result in higher quality images but take longer to generate.
1 <= x <= 80Random seed for image generation. Use -1 for a random seed.
x >= -1Guidance scale for the model. Higher values make the image adhere more closely to the prompt.
0 <= x <= 100A text description of the non-desired image(s).
2000The format of the output image(s).
webp, jpg, png The way output image will be returned.
b64_json, url Was this page helpful?