For old version, see v3
branch and https://paint.leafyee.xyz
- Text-to-image: supports multiple models
- Image-to-text: convert local images to prompts
- Prompt supports Chinese and English (Chinese will automatically call
AI
translation) API
provided byCloudflareAI
andHuggingFace
You can use either Fullstack
or Client-Server
mode.
Set following environment variables in .env
file or Vercel
.
Key | Value | Required |
---|---|---|
CF_USER_ID |
Cloudflare user id |
✅ |
CF_AI_API_KEY |
Cloudflare AI api key |
✅ |
HF_API_KEY |
HuggingFace api key |
The free plan of
Vercel
has a limit of 10s for each request, which may cause504
error (especially when usingHuggingFace
models). You can subscribe to aVercel
paid plan, run the server locally, or useClient-Server
mode.
Deploy the server to Cloudflare Workers
(see this project) and set following environment variables in .env
file or Vercel
.
Key | Value | Required |
---|---|---|
NEXT_PUBLIC_WORKERS_SERVER |
Server url (e.g. https://api.xxx.workers.dev ) |
✅ |
Once
NEXT_PUBLIC_WORKERS_SERVER
is set, all the other environment variables will be ignored.
Deploy this project to Vercel
(remember to set environment variables).
429
error: You may have exceeded theHuggingFace
api request limit. Please wait for a while, reduce the frequency of requests, and consider subscribing to a paid plan.504
error: The request have exceeded theVercel
time limit. See above for resolution.
git clone https://github.com/LeafYeeXYZ/PainterLeaf.git
bun i
If you haven't installed
Bun
yet, please refer to Bun.sh.
bun dev
bun run build