Documentation

Welcome to the world of AI made fun and easy

Dive In

What We Do
AI Chat
Special Modes

Online Mode: An add-on that enables AI Chat to browse the web for real-time information. This feature is a great way to learn new things and explore fresh topics. Simply sign in to your DeepAI account (no subscription required) to access this mode.

Genius Mode: An enhanced version of AI Chat that provides more knowledge, fewer errors, improved reasoning skills, better verbal fluidity, and an overall superior performance. Due to the larger AI model, Genius Mode is only available via subscription to DeepAI Pro. However, the added benefits often make it a worthwhile investment.

Super Genius Mode: An upgrade of Genius Mode designed for tackling even harder problems. It uses a reasoning model ideal for solving complex logic, math, and coding challenges. It might take a bit longer to respond as it "thinks" through the problem, but it's often well worth the wait. This mode is also available only via subscription to DeepAI Pro.

Ideas for Chatting with the AI
  • Can you describe the concept of relativity in layman's terms?
  • What are some unique and entertaining ways to celebrate a friend's anniversary?
  • Could you walk me through how to use loops in Python?
Strengths
  • Can recall information from previous conversations to provide personalized responses.
  • Allows users to correct any misunderstandings or errors in previous interactions.
  • Is programmed to refuse inappropriate or harmful requests.
Weaknesses
  • Can occasionally provide incorrect information due to limitations in its training data or understanding.
  • May inadvertently provide instructions or suggestions that are harmful or biased without realizing it.
  • Has limited knowledge of current events and developments beyond the training data cutoff of 2021.
AI Image Generator
AI Video Generator
AI Image Editor
AI Characters


Note: Only public submissions need to be reviewed.

Pricing
APIs

Pricing: $5 per 100 API calls, or $5 per 500 for DeepAI Pro subscribers

AI Image Generator

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

Background Remover

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

AI Image Editor

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

AI Headshot Generator

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

Image Colorizer

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

AI Selfie Generator

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

Super Resolution

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

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

Creative Upscale

cURL Examples

# Example posting a image URL:

curl \
    -F 'image=YOUR_IMAGE_URL' \
    -H 'api-key:YOUR_API_KEY' \
    https://api.deepai.org/api/creative-upscale 


# 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/creative-upscale 

Javascript Examples

// Example posting a image URL:
(async function() {
    const resp = await fetch('https://api.deepai.org/api/creative-upscale', {
        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/creative-upscale', {
           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/creative-upscale', {
           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/creative-upscale",
    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/creative-upscale",
    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/creative-upscale', 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/creative-upscale', timeout: 600,
    headers: {'api-key' => 'YOUR_API_KEY'},
    payload: {
        'image' => File.new('/path/to/your/file.jpg'),
    }
)
puts r

Image Replace

Replace and edit objects in images with AI.

cURL Examples

# Example posting a text URL:

curl \
    -F 'text=YOUR_TEXT_URL' \
    -F 'mask=YOUR_TEXT_URL' \
    -F 'image=YOUR_TEXT_URL' \
    -H 'api-key:YOUR_API_KEY' \
    https://api.deepai.org/api/image-replace 


# Example posting a local text file:

curl \
    -F 'text=@/path/to/your/file.txt' \
    -F 'mask=@/path/to/your/file.jpg' \
    -F 'image=@/path/to/your/file.jpg' \
    -H 'api-key:YOUR_API_KEY' \
    https://api.deepai.org/api/image-replace 


# Example directly sending a text string:

curl \
    -F 'text=YOUR_TEXT_HERE' \
    -F 'mask=YOUR_TEXT_HERE' \
    -F 'image=YOUR_TEXT_HERE' \
    -H 'api-key:YOUR_API_KEY' \
    https://api.deepai.org/api/image-replace 

Javascript Examples

// Example posting a text URL:
(async function() {
    const resp = await fetch('https://api.deepai.org/api/image-replace', {
        method: 'POST',
        headers: {
            'Content-Type': 'application/json',
            'api-key': 'YOUR_API_KEY'
        },
        body: JSON.stringify({
            text: "YOUR_TEXT_URL",
            mask: "YOUR_TEXT_URL",
            image: "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]);
       formData.append('mask', this.files[1]);
       formData.append('image', this.files[2]);

       const resp = await fetch('https://api.deepai.org/api/image-replace', {
           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 jpgFileStream = fs.createReadStream("/path/to/your/file.jpg"),
       formData.append('mask', jpgFileStream);
       const jpgFileStream = fs.createReadStream("/path/to/your/file.jpg"),
       formData.append('image', jpgFileStream);

       const resp = await fetch('https://api.deepai.org/api/image-replace', {
           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/image-replace', {
        method: 'POST',
        headers: {
            'Content-Type': 'application/json',
            'api-key': 'YOUR_API_KEY'
        },
        body: JSON.stringify({
            text: "YOUR_TEXT_HERE",
            mask: "YOUR_TEXT_HERE",
            image: "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/image-replace",
    data={
        'text': 'YOUR_TEXT_URL',
        'mask': 'YOUR_TEXT_URL',
        'image': '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/image-replace",
    files={
        'text': open('/path/to/your/file.txt', 'rb'),
        'mask': open('/path/to/your/file.jpg', 'rb'),
        'image': open('/path/to/your/file.jpg', '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/image-replace",
    data={
        'text': 'YOUR_TEXT_HERE',
        'mask': 'YOUR_TEXT_HERE',
        'image': '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/image-replace', timeout: 600,
    headers: {'api-key' => 'YOUR_API_KEY'},
    payload: {
        'text' => 'YOUR_TEXT_URL',
        'mask' => 'YOUR_TEXT_URL',
        'image' => '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/image-replace', timeout: 600,
    headers: {'api-key' => 'YOUR_API_KEY'},
    payload: {
        'text' => File.new('/path/to/your/file.txt'),
        'mask' => File.new('/path/to/your/file.jpg'),
        'image' => File.new('/path/to/your/file.jpg'),
    }
)
puts r


# Example directly sending a text string:

require 'rest_client'
r = RestClient::Request.execute(method: :post, url: 'https://api.deepai.org/api/image-replace', timeout: 600,
    headers: {'api-key' => 'YOUR_API_KEY'},
    payload: {
        'text' => 'YOUR_TEXT_HERE',
        'mask' => 'YOUR_TEXT_HERE',
        'image' => 'YOUR_TEXT_HERE',
    }
)
puts r

Expand Image

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

Sign in with Google

×

Use your Google Account to sign in to DeepAI

×

Consider DeepAI Pro

  • World's best value AI at $5 per month
  • Smarter AI Chat
  • Highest quality AI Images and Videos
  • 100% Ad-free