Welcome to the world of AI made fun and easy
Explore our artificially intelligent tools here at DeepAI
New FeaturesExperience the next level of AI with our newest features
AI ChatConverse with a genius mode chat buddy
AI Image GeneratorCreate cool pics with our different image generators
AI Video GeneratorCreate amazing videos from your own images or ideas
AI Image EditorEdit your own cool pics with our image editor generator
AI CharactersSearch our library of over a 100 different characters to chat with
PricingThorough breakdown of our membership pricing
APIsExplore what APIs we offer by reading through the docs
AI Video Generator is an AI-powered tool that transforms your images and text prompts into videos. Use it for educational videos, explaining concepts, or create engaging content for storytelling. By uploading to the video generator, you give DeepAI the right to share the image and video publicly. Please make sure you understand how it works by reading below.
DeepAI Pro Membership includes 30 video generations per month + overage of $5 per 30 more.
Pay as you go members pay at a rate of $5 per 30 video generations.
Note: Only public submissions need to be reviewed.
DeepAI Pro is a monthly subscription that provides full access to all the AI tools and user features offered by DeepAI. This includes more than 100 generative tools valued at the best price possible!
DeepAI Pro includes a number of usages of each feature per month. Below is an overview of the included monthly usage for DeepAI Pro.
If you exceed the number of images or messages included per month, they will be charged at the rates below:
This is an AI Image Generator. It creates an image from scratch from a text description.
cURL Examples
# Example posting a text URL:
curl \
-F 'text=YOUR_TEXT_URL' \
-H 'api-key:YOUR_API_KEY' \
https://api.deepai.org/api/text2img
# Example posting a local text file:
curl \
-F 'text=@/path/to/your/file.txt' \
-H 'api-key:YOUR_API_KEY' \
https://api.deepai.org/api/text2img
# Example directly sending a text string:
curl \
-F 'text=YOUR_TEXT_HERE' \
-H 'api-key:YOUR_API_KEY' \
https://api.deepai.org/api/text2img
Javascript Examples
// Example posting a text URL:
(async function() {
const resp = await fetch('https://api.deepai.org/api/text2img', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'api-key': 'YOUR_API_KEY'
},
body: JSON.stringify({
text: "YOUR_TEXT_URL",
})
});
const data = await resp.json();
console.log(data);
})()
// Example posting file picker input text (Browser only):
document.getElementById('yourFileInputId').addEventListener('change', async function() {
const formData = new FormData();
formData.append('text', this.files[0]);
const resp = await fetch('https://api.deepai.org/api/text2img', {
method: 'POST',
headers: {
'api-key': 'YOUR_API_KEY'
},
body: formData
});
const data = await resp.json();
console.log(data);
});
// Example posting a local text file (Node.js only):
const fs = require('fs');
(async function() {
const formData = new FormData();
const txtFileStream = fs.createReadStream("/path/to/your/file.txt"),
formData.append('text', txtFileStream);
const resp = await fetch('https://api.deepai.org/api/text2img', {
method: 'POST',
headers: {
'api-key': 'YOUR_API_KEY'
},
body: formData
});
const data = await resp.json();
console.log(data);
});
// Example directly sending a text string:
(async function() {
const resp = await fetch('https://api.deepai.org/api/text2img', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'api-key': 'YOUR_API_KEY'
},
body: JSON.stringify({
text: "YOUR_TEXT_HERE",
})
});
const data = await resp.json();
console.log(data);
})()
Python Examples
# Example posting a text URL:
import requests
r = requests.post(
"https://api.deepai.org/api/text2img",
data={
'text': 'YOUR_TEXT_URL',
},
headers={'api-key': 'YOUR_API_KEY'}
)
print(r.json())
# Example posting a local text file:
import requests
r = requests.post(
"https://api.deepai.org/api/text2img",
files={
'text': open('/path/to/your/file.txt', 'rb'),
},
headers={'api-key': 'YOUR_API_KEY'}
)
print(r.json())
# Example directly sending a text string:
import requests
r = requests.post(
"https://api.deepai.org/api/text2img",
data={
'text': 'YOUR_TEXT_HERE',
},
headers={'api-key': 'YOUR_API_KEY'}
)
print(r.json())
Ruby Examples
# Example posting a text URL:
require 'rest_client'
r = RestClient::Request.execute(method: :post, url: 'https://api.deepai.org/api/text2img', timeout: 600,
headers: {'api-key' => 'YOUR_API_KEY'},
payload: {
'text' => 'YOUR_TEXT_URL',
}
)
puts r
# Example posting a local text file:
require 'rest_client'
r = RestClient::Request.execute(method: :post, url: 'https://api.deepai.org/api/text2img', timeout: 600,
headers: {'api-key' => 'YOUR_API_KEY'},
payload: {
'text' => File.new('/path/to/your/file.txt'),
}
)
puts r
# Example directly sending a text string:
require 'rest_client'
r = RestClient::Request.execute(method: :post, url: 'https://api.deepai.org/api/text2img', timeout: 600,
headers: {'api-key' => 'YOUR_API_KEY'},
payload: {
'text' => 'YOUR_TEXT_HERE',
}
)
puts r
Remove image background with AI.
cURL Examples
# Example posting a image URL:
curl \
-F 'image=YOUR_IMAGE_URL' \
-H 'api-key:YOUR_API_KEY' \
https://api.deepai.org/api/background-remover
# Example posting a local image file:
curl \
-F 'image=@/path/to/your/file.jpg' \
-H 'api-key:YOUR_API_KEY' \
https://api.deepai.org/api/background-remover
Javascript Examples
// Example posting a image URL:
(async function() {
const resp = await fetch('https://api.deepai.org/api/background-remover', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'api-key': 'YOUR_API_KEY'
},
body: JSON.stringify({
image: "YOUR_IMAGE_URL",
})
});
const data = await resp.json();
console.log(data);
})()
// Example posting file picker input image (Browser only):
document.getElementById('yourFileInputId').addEventListener('change', async function() {
const formData = new FormData();
formData.append('image', this.files[0]);
const resp = await fetch('https://api.deepai.org/api/background-remover', {
method: 'POST',
headers: {
'api-key': 'YOUR_API_KEY'
},
body: formData
});
const data = await resp.json();
console.log(data);
});
// Example posting a local image file (Node.js only):
const fs = require('fs');
(async function() {
const formData = new FormData();
const jpgFileStream = fs.createReadStream("/path/to/your/file.jpg"),
formData.append('image', jpgFileStream);
const resp = await fetch('https://api.deepai.org/api/background-remover', {
method: 'POST',
headers: {
'api-key': 'YOUR_API_KEY'
},
body: formData
});
const data = await resp.json();
console.log(data);
});
Python Examples
# Example posting a image URL:
import requests
r = requests.post(
"https://api.deepai.org/api/background-remover",
data={
'image': 'YOUR_IMAGE_URL',
},
headers={'api-key': 'YOUR_API_KEY'}
)
print(r.json())
# Example posting a local image file:
import requests
r = requests.post(
"https://api.deepai.org/api/background-remover",
files={
'image': open('/path/to/your/file.jpg', 'rb'),
},
headers={'api-key': 'YOUR_API_KEY'}
)
print(r.json())
Ruby Examples
# Example posting a image URL:
require 'rest_client'
r = RestClient::Request.execute(method: :post, url: 'https://api.deepai.org/api/background-remover', timeout: 600,
headers: {'api-key' => 'YOUR_API_KEY'},
payload: {
'image' => 'YOUR_IMAGE_URL',
}
)
puts r
# Example posting a local image file:
require 'rest_client'
r = RestClient::Request.execute(method: :post, url: 'https://api.deepai.org/api/background-remover', timeout: 600,
headers: {'api-key' => 'YOUR_API_KEY'},
payload: {
'image' => File.new('/path/to/your/file.jpg'),
}
)
puts r
Edit images with AI.
cURL Examples
# Example posting a image URL:
curl \
-F 'image=YOUR_IMAGE_URL' \
-F 'text=YOUR_IMAGE_URL' \
-H 'api-key:YOUR_API_KEY' \
https://api.deepai.org/api/image-editor
# Example posting a local image file:
curl \
-F 'image=@/path/to/your/file.jpg' \
-F 'text=@/path/to/your/file.txt' \
-H 'api-key:YOUR_API_KEY' \
https://api.deepai.org/api/image-editor
Javascript Examples
// Example posting a image URL:
(async function() {
const resp = await fetch('https://api.deepai.org/api/image-editor', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'api-key': 'YOUR_API_KEY'
},
body: JSON.stringify({
image: "YOUR_IMAGE_URL",
text: "YOUR_IMAGE_URL",
})
});
const data = await resp.json();
console.log(data);
})()
// Example posting file picker input image (Browser only):
document.getElementById('yourFileInputId').addEventListener('change', async function() {
const formData = new FormData();
formData.append('image', this.files[0]);
formData.append('text', this.files[1]);
const resp = await fetch('https://api.deepai.org/api/image-editor', {
method: 'POST',
headers: {
'api-key': 'YOUR_API_KEY'
},
body: formData
});
const data = await resp.json();
console.log(data);
});
// Example posting a local image file (Node.js only):
const fs = require('fs');
(async function() {
const formData = new FormData();
const jpgFileStream = fs.createReadStream("/path/to/your/file.jpg"),
formData.append('image', jpgFileStream);
const txtFileStream = fs.createReadStream("/path/to/your/file.txt"),
formData.append('text', txtFileStream);
const resp = await fetch('https://api.deepai.org/api/image-editor', {
method: 'POST',
headers: {
'api-key': 'YOUR_API_KEY'
},
body: formData
});
const data = await resp.json();
console.log(data);
});
Python Examples
# Example posting a image URL:
import requests
r = requests.post(
"https://api.deepai.org/api/image-editor",
data={
'image': 'YOUR_IMAGE_URL',
'text': 'YOUR_IMAGE_URL',
},
headers={'api-key': 'YOUR_API_KEY'}
)
print(r.json())
# Example posting a local image file:
import requests
r = requests.post(
"https://api.deepai.org/api/image-editor",
files={
'image': open('/path/to/your/file.jpg', 'rb'),
'text': open('/path/to/your/file.txt', 'rb'),
},
headers={'api-key': 'YOUR_API_KEY'}
)
print(r.json())
Ruby Examples
# Example posting a image URL:
require 'rest_client'
r = RestClient::Request.execute(method: :post, url: 'https://api.deepai.org/api/image-editor', timeout: 600,
headers: {'api-key' => 'YOUR_API_KEY'},
payload: {
'image' => 'YOUR_IMAGE_URL',
'text' => 'YOUR_IMAGE_URL',
}
)
puts r
# Example posting a local image file:
require 'rest_client'
r = RestClient::Request.execute(method: :post, url: 'https://api.deepai.org/api/image-editor', timeout: 600,
headers: {'api-key' => 'YOUR_API_KEY'},
payload: {
'image' => File.new('/path/to/your/file.jpg'),
'text' => File.new('/path/to/your/file.txt'),
}
)
puts r
Get Professional AI Headshots in seconds with Our AI Headshot Generator. Save time and money while achieving stunning, high-quality results effortlessly.
cURL Examples
# Example posting a image URL:
curl \
-F 'image=YOUR_IMAGE_URL' \
-F 'text=YOUR_IMAGE_URL' \
-H 'api-key:YOUR_API_KEY' \
https://api.deepai.org/api/ai-headshots
# Example posting a local image file:
curl \
-F 'image=@/path/to/your/file.jpg' \
-F 'text=@/path/to/your/file.txt' \
-H 'api-key:YOUR_API_KEY' \
https://api.deepai.org/api/ai-headshots
Javascript Examples
// Example posting a image URL:
(async function() {
const resp = await fetch('https://api.deepai.org/api/ai-headshots', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'api-key': 'YOUR_API_KEY'
},
body: JSON.stringify({
image: "YOUR_IMAGE_URL",
text: "YOUR_IMAGE_URL",
})
});
const data = await resp.json();
console.log(data);
})()
// Example posting file picker input image (Browser only):
document.getElementById('yourFileInputId').addEventListener('change', async function() {
const formData = new FormData();
formData.append('image', this.files[0]);
formData.append('text', this.files[1]);
const resp = await fetch('https://api.deepai.org/api/ai-headshots', {
method: 'POST',
headers: {
'api-key': 'YOUR_API_KEY'
},
body: formData
});
const data = await resp.json();
console.log(data);
});
// Example posting a local image file (Node.js only):
const fs = require('fs');
(async function() {
const formData = new FormData();
const jpgFileStream = fs.createReadStream("/path/to/your/file.jpg"),
formData.append('image', jpgFileStream);
const txtFileStream = fs.createReadStream("/path/to/your/file.txt"),
formData.append('text', txtFileStream);
const resp = await fetch('https://api.deepai.org/api/ai-headshots', {
method: 'POST',
headers: {
'api-key': 'YOUR_API_KEY'
},
body: formData
});
const data = await resp.json();
console.log(data);
});
Python Examples
# Example posting a image URL:
import requests
r = requests.post(
"https://api.deepai.org/api/ai-headshots",
data={
'image': 'YOUR_IMAGE_URL',
'text': 'YOUR_IMAGE_URL',
},
headers={'api-key': 'YOUR_API_KEY'}
)
print(r.json())
# Example posting a local image file:
import requests
r = requests.post(
"https://api.deepai.org/api/ai-headshots",
files={
'image': open('/path/to/your/file.jpg', 'rb'),
'text': open('/path/to/your/file.txt', 'rb'),
},
headers={'api-key': 'YOUR_API_KEY'}
)
print(r.json())
Ruby Examples
# Example posting a image URL:
require 'rest_client'
r = RestClient::Request.execute(method: :post, url: 'https://api.deepai.org/api/ai-headshots', timeout: 600,
headers: {'api-key' => 'YOUR_API_KEY'},
payload: {
'image' => 'YOUR_IMAGE_URL',
'text' => 'YOUR_IMAGE_URL',
}
)
puts r
# Example posting a local image file:
require 'rest_client'
r = RestClient::Request.execute(method: :post, url: 'https://api.deepai.org/api/ai-headshots', timeout: 600,
headers: {'api-key' => 'YOUR_API_KEY'},
payload: {
'image' => File.new('/path/to/your/file.jpg'),
'text' => File.new('/path/to/your/file.txt'),
}
)
puts r
Add color to old family photos and historic images, or bring an old film back to life with colorization.
cURL Examples
# Example posting a image URL:
curl \
-F 'image=YOUR_IMAGE_URL' \
-H 'api-key:YOUR_API_KEY' \
https://api.deepai.org/api/colorizer
# Example posting a local image file:
curl \
-F 'image=@/path/to/your/file.jpg' \
-H 'api-key:YOUR_API_KEY' \
https://api.deepai.org/api/colorizer
Javascript Examples
// Example posting a image URL:
(async function() {
const resp = await fetch('https://api.deepai.org/api/colorizer', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'api-key': 'YOUR_API_KEY'
},
body: JSON.stringify({
image: "YOUR_IMAGE_URL",
})
});
const data = await resp.json();
console.log(data);
})()
// Example posting file picker input image (Browser only):
document.getElementById('yourFileInputId').addEventListener('change', async function() {
const formData = new FormData();
formData.append('image', this.files[0]);
const resp = await fetch('https://api.deepai.org/api/colorizer', {
method: 'POST',
headers: {
'api-key': 'YOUR_API_KEY'
},
body: formData
});
const data = await resp.json();
console.log(data);
});
// Example posting a local image file (Node.js only):
const fs = require('fs');
(async function() {
const formData = new FormData();
const jpgFileStream = fs.createReadStream("/path/to/your/file.jpg"),
formData.append('image', jpgFileStream);
const resp = await fetch('https://api.deepai.org/api/colorizer', {
method: 'POST',
headers: {
'api-key': 'YOUR_API_KEY'
},
body: formData
});
const data = await resp.json();
console.log(data);
});
Python Examples
# Example posting a image URL:
import requests
r = requests.post(
"https://api.deepai.org/api/colorizer",
data={
'image': 'YOUR_IMAGE_URL',
},
headers={'api-key': 'YOUR_API_KEY'}
)
print(r.json())
# Example posting a local image file:
import requests
r = requests.post(
"https://api.deepai.org/api/colorizer",
files={
'image': open('/path/to/your/file.jpg', 'rb'),
},
headers={'api-key': 'YOUR_API_KEY'}
)
print(r.json())
Ruby Examples
# Example posting a image URL:
require 'rest_client'
r = RestClient::Request.execute(method: :post, url: 'https://api.deepai.org/api/colorizer', timeout: 600,
headers: {'api-key' => 'YOUR_API_KEY'},
payload: {
'image' => 'YOUR_IMAGE_URL',
}
)
puts r
# Example posting a local image file:
require 'rest_client'
r = RestClient::Request.execute(method: :post, url: 'https://api.deepai.org/api/colorizer', timeout: 600,
headers: {'api-key' => 'YOUR_API_KEY'},
payload: {
'image' => File.new('/path/to/your/file.jpg'),
}
)
puts r
Make Yourself AI! Upload an image, add a text prompt, and receive a stunning AI portrait. Experience personalized art like never before!
cURL Examples
# Example posting a image URL:
curl \
-F 'image=YOUR_IMAGE_URL' \
-F 'text=YOUR_IMAGE_URL' \
-H 'api-key:YOUR_API_KEY' \
https://api.deepai.org/api/ai-selfie-generator
# Example posting a local image file:
curl \
-F 'image=@/path/to/your/file.jpg' \
-F 'text=@/path/to/your/file.txt' \
-H 'api-key:YOUR_API_KEY' \
https://api.deepai.org/api/ai-selfie-generator
Javascript Examples
// Example posting a image URL:
(async function() {
const resp = await fetch('https://api.deepai.org/api/ai-selfie-generator', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'api-key': 'YOUR_API_KEY'
},
body: JSON.stringify({
image: "YOUR_IMAGE_URL",
text: "YOUR_IMAGE_URL",
})
});
const data = await resp.json();
console.log(data);
})()
// Example posting file picker input image (Browser only):
document.getElementById('yourFileInputId').addEventListener('change', async function() {
const formData = new FormData();
formData.append('image', this.files[0]);
formData.append('text', this.files[1]);
const resp = await fetch('https://api.deepai.org/api/ai-selfie-generator', {
method: 'POST',
headers: {
'api-key': 'YOUR_API_KEY'
},
body: formData
});
const data = await resp.json();
console.log(data);
});
// Example posting a local image file (Node.js only):
const fs = require('fs');
(async function() {
const formData = new FormData();
const jpgFileStream = fs.createReadStream("/path/to/your/file.jpg"),
formData.append('image', jpgFileStream);
const txtFileStream = fs.createReadStream("/path/to/your/file.txt"),
formData.append('text', txtFileStream);
const resp = await fetch('https://api.deepai.org/api/ai-selfie-generator', {
method: 'POST',
headers: {
'api-key': 'YOUR_API_KEY'
},
body: formData
});
const data = await resp.json();
console.log(data);
});
Python Examples
# Example posting a image URL:
import requests
r = requests.post(
"https://api.deepai.org/api/ai-selfie-generator",
data={
'image': 'YOUR_IMAGE_URL',
'text': 'YOUR_IMAGE_URL',
},
headers={'api-key': 'YOUR_API_KEY'}
)
print(r.json())
# Example posting a local image file:
import requests
r = requests.post(
"https://api.deepai.org/api/ai-selfie-generator",
files={
'image': open('/path/to/your/file.jpg', 'rb'),
'text': open('/path/to/your/file.txt', 'rb'),
},
headers={'api-key': 'YOUR_API_KEY'}
)
print(r.json())
Ruby Examples
# Example posting a image URL:
require 'rest_client'
r = RestClient::Request.execute(method: :post, url: 'https://api.deepai.org/api/ai-selfie-generator', timeout: 600,
headers: {'api-key' => 'YOUR_API_KEY'},
payload: {
'image' => 'YOUR_IMAGE_URL',
'text' => 'YOUR_IMAGE_URL',
}
)
puts r
# Example posting a local image file:
require 'rest_client'
r = RestClient::Request.execute(method: :post, url: 'https://api.deepai.org/api/ai-selfie-generator', timeout: 600,
headers: {'api-key' => 'YOUR_API_KEY'},
payload: {
'image' => File.new('/path/to/your/file.jpg'),
'text' => File.new('/path/to/your/file.txt'),
}
)
puts r
The Super Resolution API uses machine learning to clarify, sharpen, and upscale the photo without losing its content and defining characteristics. Blurry images are unfortunately common and are a problem for professionals and hobbyists alike. Super resolution uses machine learning techniques to upscale images in a fraction of a second.
cURL Examples
# Example posting a image URL:
curl \
-F 'image=YOUR_IMAGE_URL' \
-H 'api-key:YOUR_API_KEY' \
https://api.deepai.org/api/torch-srgan
# Example posting a local image file:
curl \
-F 'image=@/path/to/your/file.jpg' \
-H 'api-key:YOUR_API_KEY' \
https://api.deepai.org/api/torch-srgan
Javascript Examples
// Example posting a image URL:
(async function() {
const resp = await fetch('https://api.deepai.org/api/torch-srgan', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'api-key': 'YOUR_API_KEY'
},
body: JSON.stringify({
image: "YOUR_IMAGE_URL",
})
});
const data = await resp.json();
console.log(data);
})()
// Example posting file picker input image (Browser only):
document.getElementById('yourFileInputId').addEventListener('change', async function() {
const formData = new FormData();
formData.append('image', this.files[0]);
const resp = await fetch('https://api.deepai.org/api/torch-srgan', {
method: 'POST',
headers: {
'api-key': 'YOUR_API_KEY'
},
body: formData
});
const data = await resp.json();
console.log(data);
});
// Example posting a local image file (Node.js only):
const fs = require('fs');
(async function() {
const formData = new FormData();
const jpgFileStream = fs.createReadStream("/path/to/your/file.jpg"),
formData.append('image', jpgFileStream);
const resp = await fetch('https://api.deepai.org/api/torch-srgan', {
method: 'POST',
headers: {
'api-key': 'YOUR_API_KEY'
},
body: formData
});
const data = await resp.json();
console.log(data);
});
Python Examples
# Example posting a image URL:
import requests
r = requests.post(
"https://api.deepai.org/api/torch-srgan",
data={
'image': 'YOUR_IMAGE_URL',
},
headers={'api-key': 'YOUR_API_KEY'}
)
print(r.json())
# Example posting a local image file:
import requests
r = requests.post(
"https://api.deepai.org/api/torch-srgan",
files={
'image': open('/path/to/your/file.jpg', 'rb'),
},
headers={'api-key': 'YOUR_API_KEY'}
)
print(r.json())
Ruby Examples
# Example posting a image URL:
require 'rest_client'
r = RestClient::Request.execute(method: :post, url: 'https://api.deepai.org/api/torch-srgan', timeout: 600,
headers: {'api-key' => 'YOUR_API_KEY'},
payload: {
'image' => 'YOUR_IMAGE_URL',
}
)
puts r
# Example posting a local image file:
require 'rest_client'
r = RestClient::Request.execute(method: :post, url: 'https://api.deepai.org/api/torch-srgan', timeout: 600,
headers: {'api-key' => 'YOUR_API_KEY'},
payload: {
'image' => File.new('/path/to/your/file.jpg'),
}
)
puts r
Waifu2x is an algorithm that upscales images while reducing noise within the image. It gets its name from the anime-style art known as 'waifu' that it was largely trained on. Even though waifus made up most of the training data, this waifu2x api still performs well on photographs and other types of imagery. You can use Waifu2x to double the size of your images while reducing noise.
cURL Examples
# Example posting a image URL:
curl \
-F 'image=YOUR_IMAGE_URL' \
-H 'api-key:YOUR_API_KEY' \
https://api.deepai.org/api/waifu2x
# Example posting a local image file:
curl \
-F 'image=@/path/to/your/file.jpg' \
-H 'api-key:YOUR_API_KEY' \
https://api.deepai.org/api/waifu2x
Javascript Examples
// Example posting a image URL:
(async function() {
const resp = await fetch('https://api.deepai.org/api/waifu2x', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'api-key': 'YOUR_API_KEY'
},
body: JSON.stringify({
image: "YOUR_IMAGE_URL",
})
});
const data = await resp.json();
console.log(data);
})()
// Example posting file picker input image (Browser only):
document.getElementById('yourFileInputId').addEventListener('change', async function() {
const formData = new FormData();
formData.append('image', this.files[0]);
const resp = await fetch('https://api.deepai.org/api/waifu2x', {
method: 'POST',
headers: {
'api-key': 'YOUR_API_KEY'
},
body: formData
});
const data = await resp.json();
console.log(data);
});
// Example posting a local image file (Node.js only):
const fs = require('fs');
(async function() {
const formData = new FormData();
const jpgFileStream = fs.createReadStream("/path/to/your/file.jpg"),
formData.append('image', jpgFileStream);
const resp = await fetch('https://api.deepai.org/api/waifu2x', {
method: 'POST',
headers: {
'api-key': 'YOUR_API_KEY'
},
body: formData
});
const data = await resp.json();
console.log(data);
});
Python Examples
# Example posting a image URL:
import requests
r = requests.post(
"https://api.deepai.org/api/waifu2x",
data={
'image': 'YOUR_IMAGE_URL',
},
headers={'api-key': 'YOUR_API_KEY'}
)
print(r.json())
# Example posting a local image file:
import requests
r = requests.post(
"https://api.deepai.org/api/waifu2x",
files={
'image': open('/path/to/your/file.jpg', 'rb'),
},
headers={'api-key': 'YOUR_API_KEY'}
)
print(r.json())
Ruby Examples
# Example posting a image URL:
require 'rest_client'
r = RestClient::Request.execute(method: :post, url: 'https://api.deepai.org/api/waifu2x', timeout: 600,
headers: {'api-key' => 'YOUR_API_KEY'},
payload: {
'image' => 'YOUR_IMAGE_URL',
}
)
puts r
# Example posting a local image file:
require 'rest_client'
r = RestClient::Request.execute(method: :post, url: 'https://api.deepai.org/api/waifu2x', timeout: 600,
headers: {'api-key' => 'YOUR_API_KEY'},
payload: {
'image' => File.new('/path/to/your/file.jpg'),
}
)
puts r
Effortlessly expand images with our AI Image Extender. Upload to uncrop and enhance your visuals with precision!
cURL Examples
# Example posting a image URL:
curl \
-F 'image=YOUR_IMAGE_URL' \
-H 'api-key:YOUR_API_KEY' \
https://api.deepai.org/api/zoom-out
# Example posting a local image file:
curl \
-F 'image=@/path/to/your/file.jpg' \
-H 'api-key:YOUR_API_KEY' \
https://api.deepai.org/api/zoom-out
Javascript Examples
// Example posting a image URL:
(async function() {
const resp = await fetch('https://api.deepai.org/api/zoom-out', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'api-key': 'YOUR_API_KEY'
},
body: JSON.stringify({
image: "YOUR_IMAGE_URL",
})
});
const data = await resp.json();
console.log(data);
})()
// Example posting file picker input image (Browser only):
document.getElementById('yourFileInputId').addEventListener('change', async function() {
const formData = new FormData();
formData.append('image', this.files[0]);
const resp = await fetch('https://api.deepai.org/api/zoom-out', {
method: 'POST',
headers: {
'api-key': 'YOUR_API_KEY'
},
body: formData
});
const data = await resp.json();
console.log(data);
});
// Example posting a local image file (Node.js only):
const fs = require('fs');
(async function() {
const formData = new FormData();
const jpgFileStream = fs.createReadStream("/path/to/your/file.jpg"),
formData.append('image', jpgFileStream);
const resp = await fetch('https://api.deepai.org/api/zoom-out', {
method: 'POST',
headers: {
'api-key': 'YOUR_API_KEY'
},
body: formData
});
const data = await resp.json();
console.log(data);
});
Python Examples
# Example posting a image URL:
import requests
r = requests.post(
"https://api.deepai.org/api/zoom-out",
data={
'image': 'YOUR_IMAGE_URL',
},
headers={'api-key': 'YOUR_API_KEY'}
)
print(r.json())
# Example posting a local image file:
import requests
r = requests.post(
"https://api.deepai.org/api/zoom-out",
files={
'image': open('/path/to/your/file.jpg', 'rb'),
},
headers={'api-key': 'YOUR_API_KEY'}
)
print(r.json())
Ruby Examples
# Example posting a image URL:
require 'rest_client'
r = RestClient::Request.execute(method: :post, url: 'https://api.deepai.org/api/zoom-out', timeout: 600,
headers: {'api-key' => 'YOUR_API_KEY'},
payload: {
'image' => 'YOUR_IMAGE_URL',
}
)
puts r
# Example posting a local image file:
require 'rest_client'
r = RestClient::Request.execute(method: :post, url: 'https://api.deepai.org/api/zoom-out', timeout: 600,
headers: {'api-key' => 'YOUR_API_KEY'},
payload: {
'image' => File.new('/path/to/your/file.jpg'),
}
)
puts r