中文文档 | English
A free AI image generator powered by Pollinations AI. No login required, generate high-quality images instantly.
🌐 Live Demo: https://z-img.pics
🎬 Video Generation: VideoDance.cc - Bring your images to life!
- 🚀 Lightning Fast - Powered by Pollinations AI, sub-second response
- 🔓 No Login Required - Start creating immediately
- 🎨 High Quality - Multiple resolutions and enhancement modes
- 🌍 Multi-language - 12 language interfaces
- 💾 Local Cache - Auto-save history (7 days)
- 📱 Responsive Design - Perfect mobile experience
- 🔒 Request Signature - Anti-abuse protection
- ⚡ Rate Limiting - Built-in protection via Cloudflare Pages Function
- Frontend Framework: Next.js 14 (App Router)
- Styling: TailwindCSS
- Icons: Lucide React
- Image Generation: Pollinations AI API
- Deployment: Cloudflare Pages
- Language: TypeScript
- Clone the repository
git clone https://github.com/your-username/z-img.git
cd z-img- Install dependencies
Using npm:
npm installOr using pnpm (recommended, this project uses pnpm):
pnpm install- Configure environment variables
Copy the example environment file:
cp .env.example .env.localThen edit .env.local and fill in your Pollinations AI Token:
# Pollinations AI Token
# Get yours at: https://pollinations.ai/
POLLINATIONS_TOKEN=sk_your_actual_token_here💡 How to get Token: Visit https://pollinations.ai/, register an account, and get the server-side key starting with
sk_from your dashboard.
- Start development server
Using npm:
npm run devOr using pnpm:
pnpm dev- Open http://localhost:3000 in your browser 🎉
-
Fork this repository to your GitHub
-
Connect to Cloudflare Pages
- Login to Cloudflare Dashboard
- Go to
Workers & Pages→Create application→Pages - Connect your GitHub repository
-
Build Configuration
Framework preset: Next.js (Static HTML Export) Build command: npm run build Build output directory: out -
Set Environment Variables
Add in Cloudflare Pages project settings:
POLLINATIONS_TOKEN=sk_your_token_here -
Deploy! 🎉
vercel deployRemember to add POLLINATIONS_TOKEN environment variable in Vercel project settings.
netlify deploy --prodAlso add POLLINATIONS_TOKEN in Netlify environment variables.
This project uses the free Pollinations AI image generation API:
Endpoint: GET https://gen.pollinations.ai/image/{prompt}
Supported Parameters:
width,height- Image dimensionsseed- Random seed (reproducible)enhance- AI enhancement modemodel- Model to use (defaultzimage)negative_prompt- Negative prompts
Authentication: Add Authorization: Bearer sk_xxx header
Get your API Token: https://pollinations.ai/
z-img/
├── src/
│ ├── app/
│ │ ├── api/
│ │ │ └── generate/
│ │ │ └── route.ts # Next.js API route (local dev)
│ │ ├── globals.css
│ │ ├── layout.tsx
│ │ ├── page.tsx
│ │ ├── sitemap.ts
│ │ └── robots.ts
│ ├── components/
│ │ ├── Header.tsx # Top navigation
│ │ ├── Hero.tsx # Image generator UI
│ │ ├── Gallery.tsx # Sample gallery
│ │ ├── Features.tsx # Features showcase
│ │ ├── About.tsx # About page
│ │ ├── FAQ.tsx # FAQ accordion
│ │ ├── Footer.tsx # Footer
│ │ └── LanguageSelector.tsx # Language switcher
│ ├── i18n/
│ │ ├── locales.ts
│ │ └── translations.ts # 12 language translations
│ └── utils/
│ └── imageCache.ts # Local image cache
├── functions/
│ └── api/
│ └── generate.js # Cloudflare Pages Function
├── public/
│ └── images/ # Static images
├── .env.example # Environment variables example
└── next.config.mjs
- Request Signature Verification - Timestamp + hash signature prevents replay attacks
- Referer/Origin Check - Restrict allowed request sources
- Rate Limiting - Prevent API abuse (Cloudflare Function)
- Environment Variables - API tokens stored server-side, not exposed to frontend
- Z-Img.pics - Live demo of this project
- VideoDance.cc - AI video generation
- NanoSora.art - AI art creation platform
- Pollinations.ai - Image generation API provider
- Image editing features
- Batch generation
- More AI model options
- Community sharing
- API usage statistics
Issues and Pull Requests are welcome!
- Fork this repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License.
Questions or suggestions? Welcome to:
- Submit GitHub Issue
- Visit Live Demo
⭐ If this project helps you, please give it a Star!