curl --request POST \
--url https://api.ttapi.io/novelai/image-to-image \
--header 'Content-Type: application/json' \
--header 'TT-API-KEY: <api-key>' \
--data '
{
"prompt": "<string>",
"image": "https://xxx.png",
"n": [
"1",
"2",
"3",
"4"
],
"width": "1024",
"height": "1024",
"seed": "<string>",
"steps": "23",
"scale": "5",
"negative_prompt": "<string>",
"quality_toggle": "true",
"sampler": "Euler Ancestral",
"noise_schedule": "karras",
"noise": 0,
"strength": 0.7,
"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/image-to-image"
payload = {
"prompt": "<string>",
"image": "https://xxx.png",
"n": ["1", "2", "3", "4"],
"width": "1024",
"height": "1024",
"seed": "<string>",
"steps": "23",
"scale": "5",
"negative_prompt": "<string>",
"quality_toggle": "true",
"sampler": "Euler Ancestral",
"noise_schedule": "karras",
"noise": 0,
"strength": 0.7,
"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>',
image: 'https://xxx.png',
n: ['1', '2', '3', '4'],
width: '1024',
height: '1024',
seed: '<string>',
steps: '23',
scale: '5',
negative_prompt: '<string>',
quality_toggle: 'true',
sampler: 'Euler Ancestral',
noise_schedule: 'karras',
noise: 0,
strength: 0.7,
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/image-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/image-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>',
'image' => 'https://xxx.png',
'n' => [
'1',
'2',
'3',
'4'
],
'width' => '1024',
'height' => '1024',
'seed' => '<string>',
'steps' => '23',
'scale' => '5',
'negative_prompt' => '<string>',
'quality_toggle' => 'true',
'sampler' => 'Euler Ancestral',
'noise_schedule' => 'karras',
'noise' => 0,
'strength' => 0.7,
'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/image-to-image"
payload := strings.NewReader("{\n \"prompt\": \"<string>\",\n \"image\": \"https://xxx.png\",\n \"n\": [\n \"1\",\n \"2\",\n \"3\",\n \"4\"\n ],\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 \"noise\": 0,\n \"strength\": 0.7,\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/image-to-image")
.header("TT-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"prompt\": \"<string>\",\n \"image\": \"https://xxx.png\",\n \"n\": [\n \"1\",\n \"2\",\n \"3\",\n \"4\"\n ],\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 \"noise\": 0,\n \"strength\": 0.7,\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/image-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 \"image\": \"https://xxx.png\",\n \"n\": [\n \"1\",\n \"2\",\n \"3\",\n \"4\"\n ],\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 \"noise\": 0,\n \"strength\": 0.7,\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 Image to Image API Documentation
Use the NovelAI image-to-image API to transform reference images with style transfer, redraw workflows, and anime-focused visual generation.
curl --request POST \
--url https://api.ttapi.io/novelai/image-to-image \
--header 'Content-Type: application/json' \
--header 'TT-API-KEY: <api-key>' \
--data '
{
"prompt": "<string>",
"image": "https://xxx.png",
"n": [
"1",
"2",
"3",
"4"
],
"width": "1024",
"height": "1024",
"seed": "<string>",
"steps": "23",
"scale": "5",
"negative_prompt": "<string>",
"quality_toggle": "true",
"sampler": "Euler Ancestral",
"noise_schedule": "karras",
"noise": 0,
"strength": 0.7,
"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/image-to-image"
payload = {
"prompt": "<string>",
"image": "https://xxx.png",
"n": ["1", "2", "3", "4"],
"width": "1024",
"height": "1024",
"seed": "<string>",
"steps": "23",
"scale": "5",
"negative_prompt": "<string>",
"quality_toggle": "true",
"sampler": "Euler Ancestral",
"noise_schedule": "karras",
"noise": 0,
"strength": 0.7,
"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>',
image: 'https://xxx.png',
n: ['1', '2', '3', '4'],
width: '1024',
height: '1024',
seed: '<string>',
steps: '23',
scale: '5',
negative_prompt: '<string>',
quality_toggle: 'true',
sampler: 'Euler Ancestral',
noise_schedule: 'karras',
noise: 0,
strength: 0.7,
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/image-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/image-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>',
'image' => 'https://xxx.png',
'n' => [
'1',
'2',
'3',
'4'
],
'width' => '1024',
'height' => '1024',
'seed' => '<string>',
'steps' => '23',
'scale' => '5',
'negative_prompt' => '<string>',
'quality_toggle' => 'true',
'sampler' => 'Euler Ancestral',
'noise_schedule' => 'karras',
'noise' => 0,
'strength' => 0.7,
'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/image-to-image"
payload := strings.NewReader("{\n \"prompt\": \"<string>\",\n \"image\": \"https://xxx.png\",\n \"n\": [\n \"1\",\n \"2\",\n \"3\",\n \"4\"\n ],\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 \"noise\": 0,\n \"strength\": 0.7,\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/image-to-image")
.header("TT-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"prompt\": \"<string>\",\n \"image\": \"https://xxx.png\",\n \"n\": [\n \"1\",\n \"2\",\n \"3\",\n \"4\"\n ],\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 \"noise\": 0,\n \"strength\": 0.7,\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/image-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 \"image\": \"https://xxx.png\",\n \"n\": [\n \"1\",\n \"2\",\n \"3\",\n \"4\"\n ],\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 \"noise\": 0,\n \"strength\": 0.7,\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."
}Authorizations
You can obtain your API key from the TTAPI Dashboard.
Body
Image description for generation or modification
Model to use
nai-diffusion-4-5-full, nai-diffusion-4-5-curated Reference image URL or base64
"https://xxx.png"
Number of images to generate 1 - 4
["1", "2", "3", "4"]
Image width
Image height
Seed
Number of sampling steps
A lower guidance scale produces softer, more painterly results. A higher guidance scale produces finer details and sharper effects.
Unwanted content
Quality toggle
Sampler
Euler Ancestral, Euler, DPM++ 2S Ancestral, DPM++ 2M SDE, DPM++ 2M, DPM++ SDE Noise schedule
karras, exponential, polyexponential Image noise, 0 <= noise <= 0.99
Strength, 0.01 <= strength <= 0.99
Character list
Show child attributes
Show child attributes
Atmosphere transfer reference
Show child attributes
Show child attributes
Precise reference
Show child attributes
Show child attributes
Callback URL. Task completion or failure will be sent to this URL. Data structure matches the fetch structure [blocked].