curl --request POST \
--url https://api.ttapi.io/novelai/text-to-image \
--header 'Content-Type: application/json' \
--header 'TT-API-KEY: <api-key>' \
--data '
{
"prompt": "<string>",
"model": "nai-diffusion-4-5-curated",
"n": 1,
"width": 1024,
"height": 1024,
"seed": "<string>",
"steps": 23,
"scale": 5,
"negative_prompt": "<string>",
"quality_toggle": true,
"sampler": "Euler Ancestral",
"noise_schedule": "karras",
"character_prompts": [
{
"prompt": "<string>",
"center": {
"x": 0.5,
"y": 0.5
},
"uc": "blurred, extra accessories"
}
],
"vibe_transfer": [
{
"image": "https://example.com/ref1.jpg",
"strength": 0.6
}
],
"character_reference": [
{
"image": "https://example.com/ref2.jpg",
"type": "character&style",
"strength": 1,
"fidelity": 0
}
],
"hook_url": "<string>"
}
'import requests
url = "https://api.ttapi.io/novelai/text-to-image"
payload = {
"prompt": "<string>",
"model": "nai-diffusion-4-5-curated",
"n": 1,
"width": 1024,
"height": 1024,
"seed": "<string>",
"steps": 23,
"scale": 5,
"negative_prompt": "<string>",
"quality_toggle": True,
"sampler": "Euler Ancestral",
"noise_schedule": "karras",
"character_prompts": [
{
"prompt": "<string>",
"center": {
"x": 0.5,
"y": 0.5
},
"uc": "blurred, extra accessories"
}
],
"vibe_transfer": [
{
"image": "https://example.com/ref1.jpg",
"strength": 0.6
}
],
"character_reference": [
{
"image": "https://example.com/ref2.jpg",
"type": "character&style",
"strength": 1,
"fidelity": 0
}
],
"hook_url": "<string>"
}
headers = {
"TT-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'TT-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
prompt: '<string>',
model: 'nai-diffusion-4-5-curated',
n: 1,
width: 1024,
height: 1024,
seed: '<string>',
steps: 23,
scale: 5,
negative_prompt: '<string>',
quality_toggle: true,
sampler: 'Euler Ancestral',
noise_schedule: 'karras',
character_prompts: [
{prompt: '<string>', center: {x: 0.5, y: 0.5}, uc: 'blurred, extra accessories'}
],
vibe_transfer: [{image: 'https://example.com/ref1.jpg', strength: 0.6}],
character_reference: [
{
image: 'https://example.com/ref2.jpg',
type: 'character&style',
strength: 1,
fidelity: 0
}
],
hook_url: '<string>'
})
};
fetch('https://api.ttapi.io/novelai/text-to-image', 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.ttapi.io/novelai/text-to-image",
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' => '<string>',
'model' => 'nai-diffusion-4-5-curated',
'n' => 1,
'width' => 1024,
'height' => 1024,
'seed' => '<string>',
'steps' => 23,
'scale' => 5,
'negative_prompt' => '<string>',
'quality_toggle' => true,
'sampler' => 'Euler Ancestral',
'noise_schedule' => 'karras',
'character_prompts' => [
[
'prompt' => '<string>',
'center' => [
'x' => 0.5,
'y' => 0.5
],
'uc' => 'blurred, extra accessories'
]
],
'vibe_transfer' => [
[
'image' => 'https://example.com/ref1.jpg',
'strength' => 0.6
]
],
'character_reference' => [
[
'image' => 'https://example.com/ref2.jpg',
'type' => 'character&style',
'strength' => 1,
'fidelity' => 0
]
],
'hook_url' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"TT-API-KEY: <api-key>"
],
]);
$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.ttapi.io/novelai/text-to-image"
payload := strings.NewReader("{\n \"prompt\": \"<string>\",\n \"model\": \"nai-diffusion-4-5-curated\",\n \"n\": 1,\n \"width\": 1024,\n \"height\": 1024,\n \"seed\": \"<string>\",\n \"steps\": 23,\n \"scale\": 5,\n \"negative_prompt\": \"<string>\",\n \"quality_toggle\": true,\n \"sampler\": \"Euler Ancestral\",\n \"noise_schedule\": \"karras\",\n \"character_prompts\": [\n {\n \"prompt\": \"<string>\",\n \"center\": {\n \"x\": 0.5,\n \"y\": 0.5\n },\n \"uc\": \"blurred, extra accessories\"\n }\n ],\n \"vibe_transfer\": [\n {\n \"image\": \"https://example.com/ref1.jpg\",\n \"strength\": 0.6\n }\n ],\n \"character_reference\": [\n {\n \"image\": \"https://example.com/ref2.jpg\",\n \"type\": \"character&style\",\n \"strength\": 1,\n \"fidelity\": 0\n }\n ],\n \"hook_url\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("TT-API-KEY", "<api-key>")
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.ttapi.io/novelai/text-to-image")
.header("TT-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"prompt\": \"<string>\",\n \"model\": \"nai-diffusion-4-5-curated\",\n \"n\": 1,\n \"width\": 1024,\n \"height\": 1024,\n \"seed\": \"<string>\",\n \"steps\": 23,\n \"scale\": 5,\n \"negative_prompt\": \"<string>\",\n \"quality_toggle\": true,\n \"sampler\": \"Euler Ancestral\",\n \"noise_schedule\": \"karras\",\n \"character_prompts\": [\n {\n \"prompt\": \"<string>\",\n \"center\": {\n \"x\": 0.5,\n \"y\": 0.5\n },\n \"uc\": \"blurred, extra accessories\"\n }\n ],\n \"vibe_transfer\": [\n {\n \"image\": \"https://example.com/ref1.jpg\",\n \"strength\": 0.6\n }\n ],\n \"character_reference\": [\n {\n \"image\": \"https://example.com/ref2.jpg\",\n \"type\": \"character&style\",\n \"strength\": 1,\n \"fidelity\": 0\n }\n ],\n \"hook_url\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ttapi.io/novelai/text-to-image")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["TT-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"prompt\": \"<string>\",\n \"model\": \"nai-diffusion-4-5-curated\",\n \"n\": 1,\n \"width\": 1024,\n \"height\": 1024,\n \"seed\": \"<string>\",\n \"steps\": 23,\n \"scale\": 5,\n \"negative_prompt\": \"<string>\",\n \"quality_toggle\": true,\n \"sampler\": \"Euler Ancestral\",\n \"noise_schedule\": \"karras\",\n \"character_prompts\": [\n {\n \"prompt\": \"<string>\",\n \"center\": {\n \"x\": 0.5,\n \"y\": 0.5\n },\n \"uc\": \"blurred, extra accessories\"\n }\n ],\n \"vibe_transfer\": [\n {\n \"image\": \"https://example.com/ref1.jpg\",\n \"strength\": 0.6\n }\n ],\n \"character_reference\": [\n {\n \"image\": \"https://example.com/ref2.jpg\",\n \"type\": \"character&style\",\n \"strength\": 1,\n \"fidelity\": 0\n }\n ],\n \"hook_url\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"status": "SUCCESS",
"message": "success",
"data": {
"jobId": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
}
}{
"status": "FAILED",
"message": "\"prompt\" cannot be empty.",
"data": {}
}{
"status": "FAILED",
"message": "Wrong TT-API-KEY or email is not activated."
}Текст в изображение
Используйте NovelAI преобразования текста в изображение API для генерации изображений в аниме-стиле по промптам для персонажей, иллюстраций, концепция искусства и креативных идей.
curl --request POST \
--url https://api.ttapi.io/novelai/text-to-image \
--header 'Content-Type: application/json' \
--header 'TT-API-KEY: <api-key>' \
--data '
{
"prompt": "<string>",
"model": "nai-diffusion-4-5-curated",
"n": 1,
"width": 1024,
"height": 1024,
"seed": "<string>",
"steps": 23,
"scale": 5,
"negative_prompt": "<string>",
"quality_toggle": true,
"sampler": "Euler Ancestral",
"noise_schedule": "karras",
"character_prompts": [
{
"prompt": "<string>",
"center": {
"x": 0.5,
"y": 0.5
},
"uc": "blurred, extra accessories"
}
],
"vibe_transfer": [
{
"image": "https://example.com/ref1.jpg",
"strength": 0.6
}
],
"character_reference": [
{
"image": "https://example.com/ref2.jpg",
"type": "character&style",
"strength": 1,
"fidelity": 0
}
],
"hook_url": "<string>"
}
'import requests
url = "https://api.ttapi.io/novelai/text-to-image"
payload = {
"prompt": "<string>",
"model": "nai-diffusion-4-5-curated",
"n": 1,
"width": 1024,
"height": 1024,
"seed": "<string>",
"steps": 23,
"scale": 5,
"negative_prompt": "<string>",
"quality_toggle": True,
"sampler": "Euler Ancestral",
"noise_schedule": "karras",
"character_prompts": [
{
"prompt": "<string>",
"center": {
"x": 0.5,
"y": 0.5
},
"uc": "blurred, extra accessories"
}
],
"vibe_transfer": [
{
"image": "https://example.com/ref1.jpg",
"strength": 0.6
}
],
"character_reference": [
{
"image": "https://example.com/ref2.jpg",
"type": "character&style",
"strength": 1,
"fidelity": 0
}
],
"hook_url": "<string>"
}
headers = {
"TT-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'TT-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
prompt: '<string>',
model: 'nai-diffusion-4-5-curated',
n: 1,
width: 1024,
height: 1024,
seed: '<string>',
steps: 23,
scale: 5,
negative_prompt: '<string>',
quality_toggle: true,
sampler: 'Euler Ancestral',
noise_schedule: 'karras',
character_prompts: [
{prompt: '<string>', center: {x: 0.5, y: 0.5}, uc: 'blurred, extra accessories'}
],
vibe_transfer: [{image: 'https://example.com/ref1.jpg', strength: 0.6}],
character_reference: [
{
image: 'https://example.com/ref2.jpg',
type: 'character&style',
strength: 1,
fidelity: 0
}
],
hook_url: '<string>'
})
};
fetch('https://api.ttapi.io/novelai/text-to-image', 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.ttapi.io/novelai/text-to-image",
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' => '<string>',
'model' => 'nai-diffusion-4-5-curated',
'n' => 1,
'width' => 1024,
'height' => 1024,
'seed' => '<string>',
'steps' => 23,
'scale' => 5,
'negative_prompt' => '<string>',
'quality_toggle' => true,
'sampler' => 'Euler Ancestral',
'noise_schedule' => 'karras',
'character_prompts' => [
[
'prompt' => '<string>',
'center' => [
'x' => 0.5,
'y' => 0.5
],
'uc' => 'blurred, extra accessories'
]
],
'vibe_transfer' => [
[
'image' => 'https://example.com/ref1.jpg',
'strength' => 0.6
]
],
'character_reference' => [
[
'image' => 'https://example.com/ref2.jpg',
'type' => 'character&style',
'strength' => 1,
'fidelity' => 0
]
],
'hook_url' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"TT-API-KEY: <api-key>"
],
]);
$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.ttapi.io/novelai/text-to-image"
payload := strings.NewReader("{\n \"prompt\": \"<string>\",\n \"model\": \"nai-diffusion-4-5-curated\",\n \"n\": 1,\n \"width\": 1024,\n \"height\": 1024,\n \"seed\": \"<string>\",\n \"steps\": 23,\n \"scale\": 5,\n \"negative_prompt\": \"<string>\",\n \"quality_toggle\": true,\n \"sampler\": \"Euler Ancestral\",\n \"noise_schedule\": \"karras\",\n \"character_prompts\": [\n {\n \"prompt\": \"<string>\",\n \"center\": {\n \"x\": 0.5,\n \"y\": 0.5\n },\n \"uc\": \"blurred, extra accessories\"\n }\n ],\n \"vibe_transfer\": [\n {\n \"image\": \"https://example.com/ref1.jpg\",\n \"strength\": 0.6\n }\n ],\n \"character_reference\": [\n {\n \"image\": \"https://example.com/ref2.jpg\",\n \"type\": \"character&style\",\n \"strength\": 1,\n \"fidelity\": 0\n }\n ],\n \"hook_url\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("TT-API-KEY", "<api-key>")
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.ttapi.io/novelai/text-to-image")
.header("TT-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"prompt\": \"<string>\",\n \"model\": \"nai-diffusion-4-5-curated\",\n \"n\": 1,\n \"width\": 1024,\n \"height\": 1024,\n \"seed\": \"<string>\",\n \"steps\": 23,\n \"scale\": 5,\n \"negative_prompt\": \"<string>\",\n \"quality_toggle\": true,\n \"sampler\": \"Euler Ancestral\",\n \"noise_schedule\": \"karras\",\n \"character_prompts\": [\n {\n \"prompt\": \"<string>\",\n \"center\": {\n \"x\": 0.5,\n \"y\": 0.5\n },\n \"uc\": \"blurred, extra accessories\"\n }\n ],\n \"vibe_transfer\": [\n {\n \"image\": \"https://example.com/ref1.jpg\",\n \"strength\": 0.6\n }\n ],\n \"character_reference\": [\n {\n \"image\": \"https://example.com/ref2.jpg\",\n \"type\": \"character&style\",\n \"strength\": 1,\n \"fidelity\": 0\n }\n ],\n \"hook_url\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ttapi.io/novelai/text-to-image")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["TT-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"prompt\": \"<string>\",\n \"model\": \"nai-diffusion-4-5-curated\",\n \"n\": 1,\n \"width\": 1024,\n \"height\": 1024,\n \"seed\": \"<string>\",\n \"steps\": 23,\n \"scale\": 5,\n \"negative_prompt\": \"<string>\",\n \"quality_toggle\": true,\n \"sampler\": \"Euler Ancestral\",\n \"noise_schedule\": \"karras\",\n \"character_prompts\": [\n {\n \"prompt\": \"<string>\",\n \"center\": {\n \"x\": 0.5,\n \"y\": 0.5\n },\n \"uc\": \"blurred, extra accessories\"\n }\n ],\n \"vibe_transfer\": [\n {\n \"image\": \"https://example.com/ref1.jpg\",\n \"strength\": 0.6\n }\n ],\n \"character_reference\": [\n {\n \"image\": \"https://example.com/ref2.jpg\",\n \"type\": \"character&style\",\n \"strength\": 1,\n \"fidelity\": 0\n }\n ],\n \"hook_url\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"status": "SUCCESS",
"message": "success",
"data": {
"jobId": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
}
}{
"status": "FAILED",
"message": "\"prompt\" cannot be empty.",
"data": {}
}{
"status": "FAILED",
"message": "Wrong TT-API-KEY or email is not activated."
}Авторизации
Вы можете получить API-ключ в панель управления TTAPI.
Тело
Описание изображения для генерации или изменения
Модель для использования
nai-diffusion-4-5-full, nai-diffusion-4-5-curated Количество изображений для создания 1–4
Ширина изображения
Высота изображения
Семя
Количество шагов отбора проб
Меньшая шкала наведения дает более мягкие и живописные результаты. Более высокая шкала наведения обеспечивает более мелкие детали и более резкие эффекты.
Нежелательный контент
Переключение качества
Сэмплер
Euler Ancestral, Euler, DPM++ 2S Ancestral, DPM++ 2M SDE, DPM++ 2M, DPM++ SDE График шума
karras, exponential, polyexponential Список персонажей
Show child attributes
Show child attributes
Справочник по передаче атмосферы
Show child attributes
Show child attributes
Точная ссылка
Show child attributes
Show child attributes
Обратный вызов URL. О завершении или неудаче задачи будет отправлено на этот URL. Структура данных соответствует структуре получение результата [blocked]. Если не установлено, вам нужно вызвать API получения результата [blocked] для запроса.