curl --request POST \
--url https://openapi.monica.im/v1/image/gen/sd \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "sd3_5",
"prompt": "An astronaut riding a rainbow unicorn, cinematic, dramatic",
"negative_prompt": "",
"seed": "42",
"size": "1024x1024",
"steps": 28,
"cfg_scale": "3.5",
"num_outputs": 1,
"output_quality": 90,
"scheduler": "K_EULER",
"num_inference_steps": 50
}
'import requests
url = "https://openapi.monica.im/v1/image/gen/sd"
payload = {
"model": "sd3_5",
"prompt": "An astronaut riding a rainbow unicorn, cinematic, dramatic",
"negative_prompt": "",
"seed": "42",
"size": "1024x1024",
"steps": 28,
"cfg_scale": "3.5",
"num_outputs": 1,
"output_quality": 90,
"scheduler": "K_EULER",
"num_inference_steps": 50
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'sd3_5',
prompt: 'An astronaut riding a rainbow unicorn, cinematic, dramatic',
negative_prompt: '',
seed: '42',
size: '1024x1024',
steps: 28,
cfg_scale: '3.5',
num_outputs: 1,
output_quality: 90,
scheduler: 'K_EULER',
num_inference_steps: 50
})
};
fetch('https://openapi.monica.im/v1/image/gen/sd', 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://openapi.monica.im/v1/image/gen/sd",
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([
'model' => 'sd3_5',
'prompt' => 'An astronaut riding a rainbow unicorn, cinematic, dramatic',
'negative_prompt' => '',
'seed' => '42',
'size' => '1024x1024',
'steps' => 28,
'cfg_scale' => '3.5',
'num_outputs' => 1,
'output_quality' => 90,
'scheduler' => 'K_EULER',
'num_inference_steps' => 50
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://openapi.monica.im/v1/image/gen/sd"
payload := strings.NewReader("{\n \"model\": \"sd3_5\",\n \"prompt\": \"An astronaut riding a rainbow unicorn, cinematic, dramatic\",\n \"negative_prompt\": \"\",\n \"seed\": \"42\",\n \"size\": \"1024x1024\",\n \"steps\": 28,\n \"cfg_scale\": \"3.5\",\n \"num_outputs\": 1,\n \"output_quality\": 90,\n \"scheduler\": \"K_EULER\",\n \"num_inference_steps\": 50\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://openapi.monica.im/v1/image/gen/sd")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"sd3_5\",\n \"prompt\": \"An astronaut riding a rainbow unicorn, cinematic, dramatic\",\n \"negative_prompt\": \"\",\n \"seed\": \"42\",\n \"size\": \"1024x1024\",\n \"steps\": 28,\n \"cfg_scale\": \"3.5\",\n \"num_outputs\": 1,\n \"output_quality\": 90,\n \"scheduler\": \"K_EULER\",\n \"num_inference_steps\": 50\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://openapi.monica.im/v1/image/gen/sd")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"sd3_5\",\n \"prompt\": \"An astronaut riding a rainbow unicorn, cinematic, dramatic\",\n \"negative_prompt\": \"\",\n \"seed\": \"42\",\n \"size\": \"1024x1024\",\n \"steps\": 28,\n \"cfg_scale\": \"3.5\",\n \"num_outputs\": 1,\n \"output_quality\": 90,\n \"scheduler\": \"K_EULER\",\n \"num_inference_steps\": 50\n}"
response = http.request(request)
puts response.read_body{
"data": [
{
"url": "<string>"
}
]
}Stable Diffusion models
curl --request POST \
--url https://openapi.monica.im/v1/image/gen/sd \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "sd3_5",
"prompt": "An astronaut riding a rainbow unicorn, cinematic, dramatic",
"negative_prompt": "",
"seed": "42",
"size": "1024x1024",
"steps": 28,
"cfg_scale": "3.5",
"num_outputs": 1,
"output_quality": 90,
"scheduler": "K_EULER",
"num_inference_steps": 50
}
'import requests
url = "https://openapi.monica.im/v1/image/gen/sd"
payload = {
"model": "sd3_5",
"prompt": "An astronaut riding a rainbow unicorn, cinematic, dramatic",
"negative_prompt": "",
"seed": "42",
"size": "1024x1024",
"steps": 28,
"cfg_scale": "3.5",
"num_outputs": 1,
"output_quality": 90,
"scheduler": "K_EULER",
"num_inference_steps": 50
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'sd3_5',
prompt: 'An astronaut riding a rainbow unicorn, cinematic, dramatic',
negative_prompt: '',
seed: '42',
size: '1024x1024',
steps: 28,
cfg_scale: '3.5',
num_outputs: 1,
output_quality: 90,
scheduler: 'K_EULER',
num_inference_steps: 50
})
};
fetch('https://openapi.monica.im/v1/image/gen/sd', 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://openapi.monica.im/v1/image/gen/sd",
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([
'model' => 'sd3_5',
'prompt' => 'An astronaut riding a rainbow unicorn, cinematic, dramatic',
'negative_prompt' => '',
'seed' => '42',
'size' => '1024x1024',
'steps' => 28,
'cfg_scale' => '3.5',
'num_outputs' => 1,
'output_quality' => 90,
'scheduler' => 'K_EULER',
'num_inference_steps' => 50
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://openapi.monica.im/v1/image/gen/sd"
payload := strings.NewReader("{\n \"model\": \"sd3_5\",\n \"prompt\": \"An astronaut riding a rainbow unicorn, cinematic, dramatic\",\n \"negative_prompt\": \"\",\n \"seed\": \"42\",\n \"size\": \"1024x1024\",\n \"steps\": 28,\n \"cfg_scale\": \"3.5\",\n \"num_outputs\": 1,\n \"output_quality\": 90,\n \"scheduler\": \"K_EULER\",\n \"num_inference_steps\": 50\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://openapi.monica.im/v1/image/gen/sd")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"sd3_5\",\n \"prompt\": \"An astronaut riding a rainbow unicorn, cinematic, dramatic\",\n \"negative_prompt\": \"\",\n \"seed\": \"42\",\n \"size\": \"1024x1024\",\n \"steps\": 28,\n \"cfg_scale\": \"3.5\",\n \"num_outputs\": 1,\n \"output_quality\": 90,\n \"scheduler\": \"K_EULER\",\n \"num_inference_steps\": 50\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://openapi.monica.im/v1/image/gen/sd")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"sd3_5\",\n \"prompt\": \"An astronaut riding a rainbow unicorn, cinematic, dramatic\",\n \"negative_prompt\": \"\",\n \"seed\": \"42\",\n \"size\": \"1024x1024\",\n \"steps\": 28,\n \"cfg_scale\": \"3.5\",\n \"num_outputs\": 1,\n \"output_quality\": 90,\n \"scheduler\": \"K_EULER\",\n \"num_inference_steps\": 50\n}"
response = http.request(request)
puts response.read_body{
"data": [
{
"url": "<string>"
}
]
}- Efficient image generation model
- Good quality and performance
- Suitable for general use
- Advanced model with better prompting
- Higher image quality and details
- Ideal for professional work
- Latest model with best quality
- Exceptional detail and realism
- Superior artistic capabilities
- Stable Diffusion XL 1.0
- Stable Diffusion 3
- Stable Diffusion 3.5 Large
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
The Stable Diffusion model version to use.
sdxl, sd3, sd3_5 "sd3_5"
Text prompt for image generation.
1 - 4000"An astronaut riding a rainbow unicorn, cinematic, dramatic"
Description of what to exclude from the image. Only supports sdxl.
4000""
Random seed for reproducible generations.
x <= 4294967295"42"
The size of the generated images.
1024x1024, 1344x768, 768x1344 "1024x1024"
Number of steps to run the sampler for. Supports sd3 and sd3_5. For sd3, must be between 1 and 28, default is 28. For sd3_5, must be between 1 and 50, default is 40.
28
The guidance scale tells the model how similar the output should be to the prompt. For sd3 and sd3_5, must be between 0 and 20. For sdxl, must be between 1 and 50. Default is 3.5 for sd3, 4.5 for sd3_5, and 7.5 for sdxl.
"3.5"
Number of images to generate. Only supports sdxl.
1 <= x <= 41
Quality of the output images, from 0 to 100. 100 is best quality, 0 is lowest quality. Supports for sd3 and sd3_5.
x <= 10090
Which sampler to use for the diffusion process. Only supports sdxl.
K_EULER, DDIM, DDPM, K_DPMPP_2M, K_DPMPP_2S_ANCESTRAL, K_DPM_2, K_DPM_2_ANCESTRAL, K_EULER_ANCESTRAL, K_HEUN, K_LMS "K_EULER"
Number of denoising steps. Between 1 and 500. Only supports sdxl.
1 <= x <= 50050
Response
Success
An array of generated image URLs.
Show child attributes
Show child attributes