DEV Community

Cover image for Building Hayao AI: How We Created a Next-Gen AI Photo Editor
Jianping Liu
Jianping Liu

Posted on

Building Hayao AI: How We Created a Next-Gen AI Photo Editor

AI-powered creativity tools are becoming mainstream, and at Hayao AI, we wanted to push photo editing beyond filters and sliders. Our goal was simple: let anyone transform an image just by describing it in plain language.

Today, Hayao AI is used to edit, generate, and transform photos with AI text prompts. Over 120,000 photos have already been edited on the platform by 1,000+ creators worldwide.

But behind the simple UI lies a carefully designed technical stack. Let’s break it down.

⚙️ Tech Stack Behind Hayao AI

  • Frontend: Built with Next.js for SSR/ISR performance, plus TailwindCSS for styling. The UI is optimized for drag-and-drop image uploads and real-time prompt editing.
  • Backend: Serverless functions on Vercel + FastAPI microservices handle API orchestration. We use Redis for job queuing and caching AI responses to minimize latency.
  • AI Models:
    • Google Nano Banana – high character consistency for character design & storytelling.
    • Seedream 4.0 – fast batch consistency for multiple outputs.
    • GPT-4o Vision – photorealistic image generation.
    • Flux Kontext – advanced typography and in-context edits.
    • Qwen Image – complex text rendering and creative outputs.
  • Storage & Delivery: Cloudflare R2 + CDN for serving high-resolution images efficiently.
  • Payments: Stripe for credit-based billing and subscriptions.

By combining multiple models and letting users choose the one best suited for their task, Hayao AI avoids the "one-size-fits-all" problem of many AI photo editors.

🛠 Developer Challenges We Solved

  1. Consistent Character Generation

    • One of the biggest requests from users was the ability to maintain the same face across different poses and styles.
    • We fine-tuned model pipelines and built in embeddings for identity preservation, especially for multi-scene character creation.
  2. Real-Time UX with Heavy Models

    • Many models take 30–60 seconds to generate images.
    • To keep UX smooth, we implemented streaming updates, progressive previews, and background job queues. Users can keep editing while results render.
  3. Prompt Flexibility

    • Our system parses user prompts into structured requests for different models.
    • Example: “Remove the background and add a cyberpunk city” gets split into background removal → style transfer → rendering across multiple pipelines.
  4. Scaling Without Breaking the Bank

    • AI inference is expensive. We use a credit system (1–4 credits per task depending on the model) to manage usage while offering a free trial tier for new users.

🚀 Features That Developers & Creators Can Try

  • AI Background Remover – clean cutouts in seconds.
  • AI Object Removal & Replacement – erase or swap objects with text prompts.
  • AI Image Generator – create images from scratch with natural language.
  • AI Art Styles – apply filters like watercolor, cyberpunk, or Ghibli-style art.
  • AI Photo Upscaler – sharpen and enhance low-res images.

All of this is accessible directly via the web app: hayao.app.

💡 Why Build This?

As developers, we’re excited about democratizing AI creativity. Hayao AI is not just for professional designers — it’s for indie creators, small businesses, and anyone who wants pro-level edits without hours of Photoshop work.

It’s also a living project. We’re actively experimenting with:

  • Fine-tuned models for brand identity consistency
  • Faster inference with LoRA adapters
  • A potential public API for developers to integrate AI editing into their own apps

✅ Try Hayao AI

If you’re a dev curious about how AI fits into the future of creative tooling, check out Hayao AI.

You can:

  • Upload a photo
  • Write a text prompt
  • Generate AI-powered edits in seconds

👉 Start for free at hayao.app

Top comments (0)