How to Get Started
pip install requestsCode language: Bash (bash)
import requests
import json
from PIL import Image
import io
import base64
api_url = "https://api.regolo.ai/v1/images/generations"
headers = {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_REGOLO_KEY"
}
data = {
"model": "Qwen-Image",
"prompt": "Create an image of a cat resting peacefully on a weathered wooden bench, surrounded by the ruins of an ancient Roman structure. The background should feature crumbling columns, arches, and mosaic tiles, all bathed in the soft, golden light of sunset (golden hour). Use pastel and warm tones (e.g., muted oranges, soft pinks, and creamy whites) to enhance the serene, nostalgic atmosphere. Ensure the lighting casts gentle shadows and highlights the textures of the ruins and the cat’s fur.",
"n": 1,
"size": "1920x1080",
"timeout": 600
}
response = requests.post(api_url, headers=headers, json=data)
if response.status_code == 200:
response_data = response.json()
for index, item in enumerate(response_data['data']):
b64_image = item['b64_json']
image_data = base64.b64decode(b64_image)
image_stream = io.BytesIO(image_data)
image = Image.open(image_stream)
output_path = f"generated_image_{index + 1}.png"
image.save(output_path)
print(f"Image saved to: {output_path}")
else:
print("Failed to generate images:", response.status_code, response.text)
Code language: Python (python)
Applications & Use Cases
- Marketing and product imagery with sharp typography, brand-safe layouts, and accurate English/Chinese text rendered directly in the scene (posters, banners, packaging).
- Portraits and character design where enhanced human realism, facial detail, and age‑appropriate features are critical for both realistic and stylized outputs.
- Natural and cinematic scenes—landscapes, water, foliage, fur, lighting—where the 2512 update improves micro‑textures and complex lighting gradients.
- UI, infographic, and data‑viz generation that combines icons, charts, and dense text while keeping layout legible and coherent for social posts, dashboards, and presentations.
- Fast, configurable text‑to‑image APIs using Diffusers or hosted providers (fal.ai, Replicate, Azure Foundry) that need a strong open‑source alternative to closed image models.