mirror of
https://github.com/direct-img/direct-img.link.git
synced 2026-10-14 16:57:53 +00:00
ai.direct-img.link serves images from the AuroraIMG-6M API on our Dokploy server (github.com/direct-img/AuroraIMG-6M) instead of searching. It takes ?src= (auroraimg-6m, case-insensitive, the default and only source for now) and ?i=, where each i gets its own seed derived from the query, so it's a different image of the same prompt. It has its own daily limit (AI_DAILY_LIMIT) and AI: cache keys / ai/ R2 prefix. Failed generations aren't cached, since they're likely temporary. On direct-img.link and free.direct-img.link, a search that finds nothing (or fewer than i working images) now serves an AI image of the query instead of bad.webp. It's kept for 24h like failures were, so a later search can still find a real image; bad.webp is only served if the AI image fails too. Its ttl is stored in KV and R2 metadata so cache hits and deduped waiters send a matching max-age. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
7 lines
386 B
JavaScript
7 lines
386 B
JavaScript
// New searches (cache misses) allowed per IP per day, reset at 00:00 UTC. Cache hits never count.
|
|
// Safe to edit by hand. Imported by the worker and by the homepage (as a static file, so no Functions quota).
|
|
// The burst limit (~10 req/10s) is a Cloudflare WAF rule, not set here.
|
|
export const DAILY_LIMIT = 25;
|
|
export const FREE_DAILY_LIMIT = 100;
|
|
export const AI_DAILY_LIMIT = 100;
|