Pomelo

Image Generation

Generate images from text prompts using various AI models. Our API supports multiple image generation providers to give you flexibility in your applications.

Midjourney

POST/api/v1/midjourney/generate

Generate high-quality, artistic images using Midjourney. This endpoint provides access to Midjourney's image generation capabilities through our platform.

Request Parameters

ParameterTypeRequiredDescription
promptstringYesThe text prompt to generate an image from
stylestringNoStyle preset to use (e.g., "raw", "cute", "scenic")
widthintegerNoWidth of the generated image (default: 512)
heightintegerNoHeight of the generated image (default: 512)
modelstringNoMidjourney model version to use (default: "5")
num_outputsintegerNoNumber of images to generate (default: 1, max: 4)

Example Request

# Python example
import requests
import json

url = "https://api.pomeloapi.example.com/api/v1/midjourney/generate"
headers = {
    "Authorization": "Bearer YOUR_API_KEY",
    "Content-Type": "application/json"
}
data = {
    "prompt": "A serene mountain landscape with a lake at sunset, photorealistic",
    "style": "scenic",
    "width": 1024,
    "height": 768,
    "model": "5",
    "num_outputs": 2
}

response = requests.post(url, headers=headers, data=json.dumps(data))
print(response.json())

Response Format

{
  "status": "success",
  "images": [
    {
      "url": "https://storage.pomeloapi.example.com/images/abc123.png",
      "id": "img_abc123",
      "created_at": "2023-06-15T10:30:45Z"
    },
    {
      "url": "https://storage.pomeloapi.example.com/images/def456.png",
      "id": "img_def456",
      "created_at": "2023-06-15T10:30:45Z"
    }
  ],
  "prompt": "A serene mountain landscape with a lake at sunset, photorealistic",
  "model": "5"
}

Flux.1

POST/api/v1/flux.1

Generate high-quality images from text using Flux.1, which offers a variety of styles and capabilities.

Request Parameters

ParameterTypeRequiredDescription
promptstringYesThe text prompt to generate an image from
negative_promptstringNoText prompt specifying what you don't want in the image
stylestringNoStyle preset (e.g., "anime", "photorealistic", "digital-art")
seedintegerNoRandom seed for reproducible image generation
stepsintegerNoNumber of denoising steps (default: 30, max: 50)
aspect_ratiostringNoAspect ratio of the output image (e.g., "1:1", "16:9", "4:3")

Example Request

# Python example
import requests
import json

url = "https://api.pomeloapi.example.com/api/v1/flux.1"
headers = {
    "Authorization": "Bearer YOUR_API_KEY",
    "Content-Type": "application/json"
}
data = {
    "prompt": "A futuristic cityscape with flying cars and holographic billboards",
    "negative_prompt": "blurry, low quality, distorted",
    "style": "digital-art",
    "steps": 40,
    "aspect_ratio": "16:9"
}

response = requests.post(url, headers=headers, data=json.dumps(data))
print(response.json())

Response Format

{
  "id": "gen_789xyz",
  "created": 1678901234,
  "images": [
    {
      "url": "https://storage.pomeloapi.example.com/images/789xyz.png",
      "width": 1024,
      "height": 576
    }
  ],
  "prompt": "A futuristic cityscape with flying cars and holographic billboards",
  "model": "flux.1",
  "seed": 42105,
  "status": "complete"
}

Best Practices

Tips for Better Results

  • Be specific and detailed in your prompts (e.g., specify lighting, style, mood)
  • Use negative prompts to remove unwanted elements
  • Experiment with different styles and presets
  • Save seeds of images you like for future variations
  • For consistent character generation, provide detailed descriptions

Content Moderation

All image generation requests are subject to content moderation. Requests that violate ourusage policieswill be rejected. This includes but is not limited to:

  • Explicit sexual content
  • Violence and gore
  • Hateful or discriminatory imagery
  • Content that infringes on intellectual property rights
  • Personal information or private data