Thumbnails
Create from image
Generate a thumbnail from a reference image.
POST
/
v2
/
thumbnail
/
image
cURL
curl -X POST "https://api.pikzels.com/v2/thumbnail/image" \
-H "X-Api-Key: pkz_yourapikey" \
-H "Content-Type: application/json" \
--data-raw '{
"prompt": "Make the cat fur white",
"image_url": "https://example.com/reference.jpg",
"model": "pkz_4_5",
"format": "16:9"
}'import requests
url = "https://api.pikzels.com/v2/thumbnail/image"
headers = {
"X-Api-Key": "pkz_yourapikey",
"Content-Type": "application/json",
}
payload = {
"prompt": "Make the cat fur white",
"image_url": "https://example.com/reference.jpg",
"model": "pkz_4_5",
"format": "16:9"
}
response = requests.post(url, headers=headers, json=payload)
print(response.json())const url = "https://api.pikzels.com/v2/thumbnail/image";
const body = {
"prompt": "Make the cat fur white",
"image_url": "https://example.com/reference.jpg",
"model": "pkz_4_5",
"format": "16:9"
};
const options = {
method: "POST",
headers: {
"X-Api-Key": "pkz_yourapikey",
"Content-Type": "application/json",
},
body: JSON.stringify(body),
};
const response = await fetch(url, options);
const data = await response.json();
console.log(data);<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.pikzels.com/v2/thumbnail/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' => 'Make the cat fur white',
'image_url' => 'https://example.com/reference.jpg',
'model' => 'pkz_4_5',
'format' => '16:9'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-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.pikzels.com/v2/thumbnail/image"
payload := strings.NewReader("{\n \"prompt\": \"Make the cat fur white\",\n \"image_url\": \"https://example.com/reference.jpg\",\n \"model\": \"pkz_4_5\",\n \"format\": \"16:9\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-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.pikzels.com/v2/thumbnail/image")
.header("X-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"prompt\": \"Make the cat fur white\",\n \"image_url\": \"https://example.com/reference.jpg\",\n \"model\": \"pkz_4_5\",\n \"format\": \"16:9\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pikzels.com/v2/thumbnail/image")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"prompt\": \"Make the cat fur white\",\n \"image_url\": \"https://example.com/reference.jpg\",\n \"model\": \"pkz_4_5\",\n \"format\": \"16:9\"\n}"
response = http.request(request)
puts response.read_body{
"model": "pkz_4_5",
"output": "https://cdn.pikzels.com/example.png",
"prompt_compacted": false,
"request_id": "3c6f4a7d-8f3d-4a12-96bb-1f5e2d0c5678"
}{
"request_id": "18b2ad5e-2a9e-4d3f-b9a8-9f2a1e0b1234",
"status": "IN_QUEUE",
"status_url": "https://api.pikzels.com/v2/requests/18b2ad5e-2a9e-4d3f-b9a8-9f2a1e0b1234/status",
"response_url": "https://api.pikzels.com/v2/requests/18b2ad5e-2a9e-4d3f-b9a8-9f2a1e0b1234"
}{
"error": {
"code": "VALIDATION_ERROR",
"message": "<string>"
},
"request_id": "<string>"
}{
"error": {
"code": "VALIDATION_ERROR",
"message": "<string>"
},
"request_id": "<string>"
}{
"error": {
"code": "VALIDATION_ERROR",
"message": "<string>"
},
"request_id": "<string>"
}{
"error": {
"code": "VALIDATION_ERROR",
"message": "<string>"
},
"request_id": "<string>"
}{
"error": {
"code": "VALIDATION_ERROR",
"message": "<string>"
},
"request_id": "<string>"
}{
"error": {
"code": "VALIDATION_ERROR",
"message": "<string>"
},
"request_id": "<string>"
}{
"error": {
"code": "VALIDATION_ERROR",
"message": "<string>"
},
"request_id": "<string>"
}{
"error": {
"code": "VALIDATION_ERROR",
"message": "<string>"
},
"request_id": "<string>"
}{
"error": {
"code": "VALIDATION_ERROR",
"message": "<string>"
},
"request_id": "<string>"
}{
"error": {
"code": "VALIDATION_ERROR",
"message": "<string>"
},
"request_id": "<string>"
}{
"error": {
"code": "VALIDATION_ERROR",
"message": "<string>"
},
"request_id": "<string>"
}{
"error": {
"code": "VALIDATION_ERROR",
"message": "<string>"
},
"request_id": "<string>"
}{
"error": {
"code": "VALIDATION_ERROR",
"message": "<string>"
},
"request_id": "<string>"
}{
"error": {
"code": "VALIDATION_ERROR",
"message": "<string>"
},
"request_id": "<string>"
}Body
application/json
Model that generates the thumbnail. See Models for what each supports.
Available options:
pkz_2, pkz_3, pkz_4, pkz_4_5 Up to 3 persona IDs from List personas and styles, each listed once, combined in the same thumbnail.
Maximum array length:
3Style ID from List personas and styles.
Set true to get a request ID at once and fetch the result later. See Async Requests.
⌘I
cURL
curl -X POST "https://api.pikzels.com/v2/thumbnail/image" \
-H "X-Api-Key: pkz_yourapikey" \
-H "Content-Type: application/json" \
--data-raw '{
"prompt": "Make the cat fur white",
"image_url": "https://example.com/reference.jpg",
"model": "pkz_4_5",
"format": "16:9"
}'import requests
url = "https://api.pikzels.com/v2/thumbnail/image"
headers = {
"X-Api-Key": "pkz_yourapikey",
"Content-Type": "application/json",
}
payload = {
"prompt": "Make the cat fur white",
"image_url": "https://example.com/reference.jpg",
"model": "pkz_4_5",
"format": "16:9"
}
response = requests.post(url, headers=headers, json=payload)
print(response.json())const url = "https://api.pikzels.com/v2/thumbnail/image";
const body = {
"prompt": "Make the cat fur white",
"image_url": "https://example.com/reference.jpg",
"model": "pkz_4_5",
"format": "16:9"
};
const options = {
method: "POST",
headers: {
"X-Api-Key": "pkz_yourapikey",
"Content-Type": "application/json",
},
body: JSON.stringify(body),
};
const response = await fetch(url, options);
const data = await response.json();
console.log(data);<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.pikzels.com/v2/thumbnail/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' => 'Make the cat fur white',
'image_url' => 'https://example.com/reference.jpg',
'model' => 'pkz_4_5',
'format' => '16:9'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-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.pikzels.com/v2/thumbnail/image"
payload := strings.NewReader("{\n \"prompt\": \"Make the cat fur white\",\n \"image_url\": \"https://example.com/reference.jpg\",\n \"model\": \"pkz_4_5\",\n \"format\": \"16:9\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-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.pikzels.com/v2/thumbnail/image")
.header("X-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"prompt\": \"Make the cat fur white\",\n \"image_url\": \"https://example.com/reference.jpg\",\n \"model\": \"pkz_4_5\",\n \"format\": \"16:9\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pikzels.com/v2/thumbnail/image")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"prompt\": \"Make the cat fur white\",\n \"image_url\": \"https://example.com/reference.jpg\",\n \"model\": \"pkz_4_5\",\n \"format\": \"16:9\"\n}"
response = http.request(request)
puts response.read_body{
"model": "pkz_4_5",
"output": "https://cdn.pikzels.com/example.png",
"prompt_compacted": false,
"request_id": "3c6f4a7d-8f3d-4a12-96bb-1f5e2d0c5678"
}{
"request_id": "18b2ad5e-2a9e-4d3f-b9a8-9f2a1e0b1234",
"status": "IN_QUEUE",
"status_url": "https://api.pikzels.com/v2/requests/18b2ad5e-2a9e-4d3f-b9a8-9f2a1e0b1234/status",
"response_url": "https://api.pikzels.com/v2/requests/18b2ad5e-2a9e-4d3f-b9a8-9f2a1e0b1234"
}{
"error": {
"code": "VALIDATION_ERROR",
"message": "<string>"
},
"request_id": "<string>"
}{
"error": {
"code": "VALIDATION_ERROR",
"message": "<string>"
},
"request_id": "<string>"
}{
"error": {
"code": "VALIDATION_ERROR",
"message": "<string>"
},
"request_id": "<string>"
}{
"error": {
"code": "VALIDATION_ERROR",
"message": "<string>"
},
"request_id": "<string>"
}{
"error": {
"code": "VALIDATION_ERROR",
"message": "<string>"
},
"request_id": "<string>"
}{
"error": {
"code": "VALIDATION_ERROR",
"message": "<string>"
},
"request_id": "<string>"
}{
"error": {
"code": "VALIDATION_ERROR",
"message": "<string>"
},
"request_id": "<string>"
}{
"error": {
"code": "VALIDATION_ERROR",
"message": "<string>"
},
"request_id": "<string>"
}{
"error": {
"code": "VALIDATION_ERROR",
"message": "<string>"
},
"request_id": "<string>"
}{
"error": {
"code": "VALIDATION_ERROR",
"message": "<string>"
},
"request_id": "<string>"
}{
"error": {
"code": "VALIDATION_ERROR",
"message": "<string>"
},
"request_id": "<string>"
}{
"error": {
"code": "VALIDATION_ERROR",
"message": "<string>"
},
"request_id": "<string>"
}{
"error": {
"code": "VALIDATION_ERROR",
"message": "<string>"
},
"request_id": "<string>"
}{
"error": {
"code": "VALIDATION_ERROR",
"message": "<string>"
},
"request_id": "<string>"
}