Skip to content

WuMingDao/zenith-image-generator

Repository files navigation

Zenith Image Generator

Modern Text-to-Image Generation Web App

A sleek, dark-mode AI image generator with multiple providers,
batch generation, and one-click deployment to Cloudflare Pages.

δΈ­ζ–‡ Β· Changelog Β· Live Demo

Dark Mode UI Cloudflare Pages React Hono


Features

  • Multiple AI Providers - Gitee AI, HuggingFace Spaces, ModelScope
  • Image-to-Video - Generate videos from images (Gitee AI)
  • Dark Mode UI - Gradio-style with frosted glass effects
  • Flexible Sizing - Multiple aspect ratios (1:1, 16:9, 9:16, 4:3, etc.)
  • 4x Upscaling - RealESRGAN integration
  • Secure Storage - API keys encrypted with AES-256-GCM
  • Token Rotation - Multiple API keys with automatic failover on rate limits
  • Flow Mode - Visual canvas for batch generation (experimental)
    • Local image caching with IndexedDB blob storage
    • Dual limits: 500 images or 4GB max storage
    • LRU cleanup with user confirmation before deletion
    • Download all images before cleanup

Token Rotation

Support multiple API tokens per provider for automatic rotation when hitting rate limits (429 errors).

How to Use

Enter multiple tokens in the API settings, separated by English commas (,):

token_1, token_2, token_3

Note: You must use English comma (,), Chinese comma (,) will not work.

How It Works

  1. Uses the first available token to make API requests
  2. When a 429 (rate limit) error occurs, automatically switches to the next token
  3. Exhausted tokens are tracked and skipped for the rest of the day
  4. Token status resets daily at UTC 00:00
  5. UI shows real-time token statistics (total/active/exhausted)

Quick Start

Prerequisites

One-Click Deploy

Deploy to Cloudflare Deploy to Vercel Deploy to Netlify

See Deployment Guide for detailed instructions.

Local Development

git clone https://github.com/WuMingDao/zenith-image-generator.git
cd zenith-image-generator
pnpm install

# Configure environment
cp apps/web/.env.example apps/web/.env

# Terminal 1
pnpm dev:api

# Terminal 2
pnpm dev:web

Open http://localhost:5173

πŸ“– Full Development Guide

API Usage

After deployment, you can call the API directly:

curl -X POST https://your-project.pages.dev/api/generate \
  -H "Content-Type: application/json" \
  -H "X-API-Key: your-gitee-api-key" \
  -d '{"prompt": "a cute cat", "width": 1024, "height": 1024}'

πŸ“– Full API Reference - Providers, parameters, code examples

Documentation

Doc Description
Contributing Local setup, LAN access, development
Deployment Cloudflare, Vercel, Netlify guides
API Reference Endpoints, parameters, code examples
Providers & Models All providers and model details

Security

How Your API Keys Are Protected

Browser ──HTTPS──→ Cloudflare Workers ──HTTPS──→ AI Provider (Gitee/HuggingFace)
   ↑                      ↑
AES-256-GCM          Proxy Layer
encrypted            (your deployment)
  • Local Encryption: API keys are encrypted with AES-256-GCM before storing in localStorage
  • Transport Security: All communications use HTTPS encryption
  • Proxy Architecture: Your keys are sent to your own Workers, not directly to AI providers

⚠️ Third-Party Deployment Warning

Important: If you use someone else's deployed instance, the operator can potentially access your API keys.

This is because:

  1. The deployment owner can add logging code to capture request headers
  2. You cannot verify what code is actually deployed (even if the repo is open source)
  3. Cloudflare provides tools like wrangler tail that can inspect live requests

Recommendations:

Scenario Risk Level Recommendation
Self-hosted deployment βœ… Safe Full control over your keys
Third-party instance ⚠️ Risky Use disposable/low-balance keys only
Unknown source ❌ Unsafe Do not enter valuable API keys

For maximum security, always deploy your own instance.

Tech Stack

Layer Tech
Frontend React 19, Vite, Tailwind CSS, shadcn/ui
Backend Hono (TypeScript)
Deploy Cloudflare Pages, Vercel, Netlify

Star History

Star History Chart

License

MIT

Acknowledgments

About

for use free online ai generate server of ui and api set

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 7

Languages