Transform Your Words into Stunning Art

Our advanced AI image generator creates unique visuals from your text prompts. Describe what you imagine, and watch it come to life!

Creating your masterpiece... This may take 20-30 seconds.

Your generated image will appear here

Lightning Fast

Our AI generates high-quality images in seconds, saving you hours of manual work.

Endless Styles

From photorealistic to abstract art, generate any style you can imagine.

Secure & Private

Your prompts and generated images are never stored or shared with third parties.

Hidroxide tip
@HydroxideTip
import requests import time # Replace with your Leonardo.AI API key API_KEY = "your-api-key-here" # API Endpoints GENERATE_URL = "https://cloud.leonardo.ai/api/rest/v1/generations" GET_GENERATION_URL = "https://cloud.leonardo.ai/api/rest/v1/generations/{generation_id}" # Headers for authentication headers = { "accept": "application/json", "content-type": "application/json", "authorization": f"Bearer {API_KEY}" } # Prompt for image generation prompt = "A futuristic cyberpunk city at night, neon lights, raining, ultra-detailed 8K" # Request payload payload = { "prompt": prompt, "negative_prompt": "blurry, low quality, distorted", "modelId": "6bef9f1b-29cb-40c7-b9df-32b51c1f67d3", # Leonardo Diffusion XL model "width": 1024, "height": 768, "num_images": 1, "guidance_scale": 7, "seed": None, # Random seed if None } # Step 1: Generate the image response = requests.post(GENERATE_URL, json=payload, headers=headers) if response.status_code == 200: generation_id = response.json().get("sdGenerationJob", {}).get("generationId") print(f"Generation started! ID: {generation_id}") # Step 2: Wait for generation to complete (polling) while True: status_response = requests.get( GET_GENERATION_URL.format(generation_id=generation_id), headers=headers ) status_data = status_response.json() if status_data.get("generations_by_pk", {}).get("status") == "COMPLETE": image_url = status_data["generations_by_pk"]["generated_images"][0]["url"] print(f"Image generated! Downloading from: {image_url}") # Step 3: Download the image image_response = requests.get(image_url) with open("leonardo_generated_image.png", "wb") as f: f.write(image_response.content) print("Image saved as 'leonardo_generated_image.png'!") break elif status_data.get("generations_by_pk", {}).get("status") == "FAILED": print("Generation failed!") break print("Waiting for generation to finish...") time.sleep(5) # Check every 5 seconds else: print("Error:", response.json())