文件最后提交记录最后更新时间
Rename image.pollinations.ai service 1 年前
🍌 Implement full nano banana (Gemini) model support (#4114) * 🍌 Implement nano banana (Gemini) image-to-image functionality ✅ COMPLETE IMPLEMENTATION: - Add nanobanana model with Vertex AI integration - Implement full image-to-image support with reference images - Fetch, encode, and send reference images to Gemini API - Add Google Cloud authentication for Vertex AI - Create comprehensive test scripts - Support multiple reference images via comma-separated URLs - Add proper TypeScript interfaces and error handling - Integrate with existing safety checks and tier authentication 🔧 TECHNICAL FEATURES: - Direct Vertex AI API integration (bypasses Portkey issues) - Base64 image encoding with MIME type detection - Robust error handling with graceful fallbacks - EXIF metadata integration - Seed tier authentication requirement - Compatible with existing image processing pipeline 🧪 TESTING: - End-to-end API testing confirmed working - Generated 1290 image tokens (2.3MB PNG output) - 9.89s generation time with reference images - Proper model recognition and routing API Usage: GET /prompt/your-prompt?model=nanobanana&image=url1,url2 * 🧹 Remove test files from nano banana implementation - Removed test-api-image-to-image.js - Removed test-gemini-image-to-image.js - Removed test-gemini-integration.js - Removed test-gemini-output.png - Removed test-vertex-simple.js Clean up development test files for production readiness. * 🔒 Security and type safety improvements for nano banana ✅ SECURITY FIXES: - Remove sensitive data logging in vertexAIClient.ts (line 173) • Sanitize Vertex AI response logs to exclude large image data • Log only metadata: candidates count, finish reason, usage stats - Fix token exposure in googleCloudAuth logs • Remove full JWT header/payload logging • Log only non-sensitive fields like algorithm and key ID length ✅ TYPE SAFETY IMPROVEMENTS: - Fix loose typing in vertexAIImageGenerator.ts • Change userInfo: any → userInfo: AuthResult • Import AuthResult type from createAndReturnImages.ts - Export interfaces from vertexAIClient.ts • Export VertexAIImageRequest, VertexAIPart, VertexAIResponse • Enable reuse across modules for better type consistency ✅ TYPESCRIPT MIGRATION: - Convert googleCloudAuth.js → googleCloudAuth.ts • Add proper TypeScript interfaces for all data structures • Improve error handling with typed error messages • Maintain backward compatibility with existing imports 🛡️ SECURITY IMPACT: - Prevents accidental logging of large image data (2MB+ base64 strings) - Reduces JWT token reconstruction risk from debug logs - Improves overall security posture of authentication module 🔧 TYPE SAFETY IMPACT: - Better IDE support and compile-time error detection - Consistent typing across Vertex AI integration - Reduced runtime type errors in production7 个月前
Move github-auth-simple to auth.pollinations.ai Relocated the github-auth-simple directory from model-context-protocol/github-auth-simple to auth.pollinations.ai in the repo root for better organization as a dedicated auth service.11 个月前
🎃 Hacktoberfest: Allow deploying to pollinations subdomain and prepare for tunstile verification (#4351) * 🎃 Add Hacktoberfest Turnstile verification system - Implement shared Turnstile verification module for both text and image APIs - Add test sitekey support for local development - Create Hono middleware wrapper for image cache worker - Add comprehensive test page with debugging - Skip verification for OPTIONS preflight requests - Update environment variable examples with Turnstile config Architecture: - /shared/turnstile.js - Single source of truth for verification logic - text.pollinations.ai/cloudflare-cache - Direct integration - image.pollinations.ai/cloudflare-cache - Hono middleware wrapper Testing: - Use test sitekey 1x00000000000000000000AA for local dev - Production sitekey 0x4AAAAAAB4-j_x8-I4ixKhz for deployment - Test page at hacktoberfest-2025/test-turnstile.html Related: Issue #4350 * 📝 Add comprehensive session summary for Turnstile implementation * 🔧 Fix Turnstile test key validation and add CORS headers - Skip hostname validation for Cloudflare test keys (they return 'example.com') - Add CORS headers to cache responses for cross-origin requests - Tested and working with test sitekey 1x00000000000000000000AA * Rename example-catgpt to catgpt for cleaner structure * Add automated Hacktoberfest deployment with DNS setup - GitHub Action deploys apps on push to hacktoberfest-2025/ - deploy-app.js creates Pages project, custom domain, and DNS CNAME - Deploys to production (--branch=master) for custom domain support - Requires CLOUDFLARE_API_TOKEN with Pages Edit + DNS Edit permissions * fix: GitHub Action workflow JSON parsing for changed-files - Fixed JSON parsing issue with escaped quotes from changed-files action - Added sed to unescape quotes before jq parsing - Added comprehensive debug logging - Added detailed app processing logs with skip reasons - Verified workflow works correctly with act local testing * feat: Add ai-dungeon-master to apps.json for automated deployment * Fix ai-dungeon-master base path for Cloudflare Pages deployment - Changed vite.config.ts base from '/pollinations/' to '/' - Fixes MIME type errors where assets were served as text/html - Assets now correctly served from /assets/ instead of /pollinations/assets/ * Add general Hacktoberfest app deployment script - Created deploy-single-app.sh for deploying any app from apps.json - Self-documenting: shows available apps when run without args - Handles build, infrastructure setup, and Cloudflare Pages deployment - Updated apps.json with descriptions and deployment notes * Allow apps.json files in version control - Added !apps.json and !**/apps.json exceptions to .gitignore - Keeps credential JSON files blocked while allowing app config files - apps.json is infrastructure-as-code and should be version controlled * Add all Hacktoberfest apps to apps.json Added 4 new apps: - example-elevator-challenge (elevator-challenge.pollinations.ai) - map-to-isometric (map-to-isometric.pollinations.ai) - product-packaging-designer (product-packaging-designer.pollinations.ai) - virtual-makeup (virtual-makeup.pollinations.ai) All use standard Vite build (npm run build -> dist/) Excluded micro.pollinations.ai (Next.js, different deployment) * 🔒 Replace production Turnstile secrets with placeholders in example files * add myceli one pager prompt (sneaking in) and revert an unnecessary gitignore thing * 🔧 Fix remaining Turnstile issues: logging, CORS, precedence, sed pattern - Remove sensitive token data from logs (only log success/error-codes) - Fix test secret precedence (production first, then test fallback) - Add CORS headers to image API Turnstile errors for consistency - Fix setup-turnstile.sh sed pattern to match actual placeholder - Clean up excessive CI debug logging * 🔧 Restore CI debug logging with TODO for future removal - Keep verbose logging for initial production testing - Added TODO comments to remove once system is stable - Helps troubleshoot deployment issues during rollout * 🔒 Remove production secrets from SESSION_SUMMARY.md documentation * 🔒 Remove ALL remaining production secrets from SESSION_SUMMARY.md - Cloudflare Account ID and Auth Token - Google Analytics API Secret and Measurement ID - Semantic cache tokens - Last remaining Turnstile secret reference * 🗑️ Remove SESSION_SUMMARY.md (contained leaked secrets) * 🔒 Re-encrypt .env files with rotated CLOUDFLARE_AUTH_TOKEN - Updated text.pollinations.ai/.encrypted.env with new token - Re-encrypted image.pollinations.ai/.encrypted.env with latest changes - Old leaked token (Pnizskqc72F...) now invalid - New token (13MK7T96HF...) active and encrypted6 个月前
Implement opposite mode for bad domains (#1369) * Implement opposite mode for bad domains This implements a feature to transform image prompts to their semantic opposites when the request comes from domains listed in the BAD_DOMAINS environment variable. Key changes: - Created badDomainHandler.js with isBadDomain and transformToOpposite functions - Updated .env.example with BAD_DOMAINS configuration - Modified normalizeAndTranslatePrompt.js to check for bad domains and transform prompts - Updated index.js to track and log bad domain transformations - Added unit tests for the new functionality Closes # 1368 * Update generateTextPortkey.js * Comment out Claude 3.5 Haiku model in availableModels.js * Implement bad domain prompt transformation with original prompt preservation * Optimize queue handling and adjust Mistral parameters * Refactor bad domain handling to use functional approach instead of class-based implementation * Update BadDomainHandler.js to include referrer in text.pollinations.ai requests and adjust transform probability to 0.6 --------- Co-authored-by: MentatBot <160964065+MentatBot@users.noreply.github.com> Co-authored-by: voodoohop <t.haferlach@gmail.com> Co-authored-by: Thomas Haferlach <thomash@pollinations.ai>1 年前
Rename image.pollinations.ai service 1 年前
cleanup: remove 53 obsolete test files across services (#3397) * cleanup: remove 53 obsolete test files across services - Removed outdated test files from auth.pollinations.ai (1 file) - Removed obsolete cache and image generation tests from image.pollinations.ai (8 files) - Removed MCP test files and vitest config from model-context-protocol (3 files) - Removed redirect test from pollinations.ai (1 file) - Removed privacy enhancement test from root test directory (1 file) - Removed extensive test suite from text.pollinations.ai (39 files) - Integration tests for various providers (Azure, Cloudflare, Gemini, Mistral, etc.) - Function calling and streaming tests - Model-specific and parameter handling tests - Observability and monitoring tests This cleanup removes legacy and redundant test files that are no longer maintained or relevant to the current codebase architecture. * cleanup: remove additional 16 test files as requested - Removed all test shell scripts (6 files): - image.pollinations.ai/cloudflare-cache/tests/*.sh (3 files) - image.pollinations.ai/test*.sh (3 files) - text.pollinations.ai/scripts/test_*.sh (3 files) - Removed all text.pollinations.ai test files (4 files): - text.pollinations.ai/test/ directory (api_test.sh, README.md, transformCloudflareRequest.js) - text.pollinations.ai/cloudflare-cache/wrangler.test.toml - Removed auth.pollinations.ai test file (1 file): - auth.pollinations.ai/test-token-performance.js - Removed test-redirect file (1 file): - pollinations.ai/public/test-redirect.html - Removed testing documentation (1 file): - text.pollinations.ai/docs/minimal-testing-approach.md Preserved TypeScript tests in image.pollinations.ai/test/ as requested. Total additional cleanup: 16 files removed. * remove unused markdown stuff9 个月前
Revert "🚀 Model-Specific Semantic Caching with Vectorize (#2888)" (#3207) This reverts commit f86b63e8125b76c04f60dd2c86e12cae054153ab.9 个月前
Revert "🚀 Model-Specific Semantic Caching with Vectorize (#2888)" (#3207) This reverts commit f86b63e8125b76c04f60dd2c86e12cae054153ab.9 个月前
1077 deploy remaining spot instance to modal - ended up just doing some tweaks to models - adding deepseek-r1 (#1105) * Create modal_service.py * Update modal_service.py and server.py for better performance - Change Docker image version for modal_service.py - Add environment variables and server restart logic - Modify heartbeat function to use Modal URL - Adjust concurrency settings in index.js - Comment out unused model in availableModels.js - Add new IPs to blocked_ips.txt - Update model mapping in generateTextCloudflare.js - Comment out queue size limit check in server.js - Use Cloudflare for 'llamalight' and 'deepseek-r1' models * Update server.py --------- Co-authored-by: Thomas Haferlach <thomash@pollinations.ai>1 年前
💰 Add cost calculation to image Tinybird telemetry (#4554) * 💰 Add cost calculation to image Tinybird telemetry - Send token_price_completion_image from registry pricing - Send token_count_completion_image (default 1 per image) - Calculate and send cost field (was hardcoded to 0) - Matches text service pattern for Grafana analytics - Enables cost tracking and reporting for image generation * Remove pre-calculated cost field - Grafana computes it - Set cost to 0 (Grafana calculates: token_count × token_price) - Keep token_price_completion_image and token_count_completion_image - Cleaner: single source of calculation, no redundant data * Use calculateCost() from registry - cleaner implementation - Replace manual cost calculation with calculateCost() function - Remove token_price_completion_image and token_count_completion_image fields - Use shared registry function (same as enter service) - Simpler: single source of truth for cost calculation7 个月前
Revert "🚀 Model-Specific Semantic Caching with Vectorize (#2888)" (#3207) This reverts commit f86b63e8125b76c04f60dd2c86e12cae054153ab.9 个月前
Fix pk_ key authentication and seedream pricing (#4819) - Fix better-auth apiKey validation by setting defaultKeyLength to 22 - Allows both pk_ (22 chars) and sk_ (64 chars) keys to pass validation - Previously pk_ keys were rejected with KEY_NOT_FOUND error - Fix seedream pricing from $0.00003 to $0.03 per image - Changed from perMillion(30) to direct 0.03 value - Correct pricing: 3 cents per image instead of 0.003 cents - Enable seedream model in image service registry - Set tier to 'nectar' for premium access - Provider: bytedance-ark Tested: Both pk_ and sk_ keys now authenticate successfully6 个月前
Add unified usage headers across services (#4638) (#4756) * Add unified token usage headers across text and image services (#4638) - Created shared DRY utility in /shared/registry/usage-headers.ts - Iterates over token types (no boilerplate) - Type-safe with existing TokenUsage type - Supports all 8 token types - Updated image service to use shared utility - Backward compatible headers - Cleaner implementation - Updated text service with usage headers - Non-streaming: Headers sent immediately - Streaming: HTTP trailers sent at end - Transform stream captures usage elegantly Header format: x-usage-{token-type} (kebab-case) Example: x-usage-prompt-text-tokens, x-usage-completion-text-tokens Closes #4638 * Add integration tests for usage headers (Issue #4638) - Image service: 5 tests verifying x-usage-* headers - Text service: 7 tests for non-streaming and streaming responses - Tests verify headers exist and have valid values - All tests passing * Remove temporary documentation files6 个月前
Add Dockerfile and .dockerignore to text and image, move affiliates.js into shared (#4656) 6 个月前
🎃 Hacktoberfest: Allow deploying to pollinations subdomain and prepare for tunstile verification (#4351) * 🎃 Add Hacktoberfest Turnstile verification system - Implement shared Turnstile verification module for both text and image APIs - Add test sitekey support for local development - Create Hono middleware wrapper for image cache worker - Add comprehensive test page with debugging - Skip verification for OPTIONS preflight requests - Update environment variable examples with Turnstile config Architecture: - /shared/turnstile.js - Single source of truth for verification logic - text.pollinations.ai/cloudflare-cache - Direct integration - image.pollinations.ai/cloudflare-cache - Hono middleware wrapper Testing: - Use test sitekey 1x00000000000000000000AA for local dev - Production sitekey 0x4AAAAAAB4-j_x8-I4ixKhz for deployment - Test page at hacktoberfest-2025/test-turnstile.html Related: Issue #4350 * 📝 Add comprehensive session summary for Turnstile implementation * 🔧 Fix Turnstile test key validation and add CORS headers - Skip hostname validation for Cloudflare test keys (they return 'example.com') - Add CORS headers to cache responses for cross-origin requests - Tested and working with test sitekey 1x00000000000000000000AA * Rename example-catgpt to catgpt for cleaner structure * Add automated Hacktoberfest deployment with DNS setup - GitHub Action deploys apps on push to hacktoberfest-2025/ - deploy-app.js creates Pages project, custom domain, and DNS CNAME - Deploys to production (--branch=master) for custom domain support - Requires CLOUDFLARE_API_TOKEN with Pages Edit + DNS Edit permissions * fix: GitHub Action workflow JSON parsing for changed-files - Fixed JSON parsing issue with escaped quotes from changed-files action - Added sed to unescape quotes before jq parsing - Added comprehensive debug logging - Added detailed app processing logs with skip reasons - Verified workflow works correctly with act local testing * feat: Add ai-dungeon-master to apps.json for automated deployment * Fix ai-dungeon-master base path for Cloudflare Pages deployment - Changed vite.config.ts base from '/pollinations/' to '/' - Fixes MIME type errors where assets were served as text/html - Assets now correctly served from /assets/ instead of /pollinations/assets/ * Add general Hacktoberfest app deployment script - Created deploy-single-app.sh for deploying any app from apps.json - Self-documenting: shows available apps when run without args - Handles build, infrastructure setup, and Cloudflare Pages deployment - Updated apps.json with descriptions and deployment notes * Allow apps.json files in version control - Added !apps.json and !**/apps.json exceptions to .gitignore - Keeps credential JSON files blocked while allowing app config files - apps.json is infrastructure-as-code and should be version controlled * Add all Hacktoberfest apps to apps.json Added 4 new apps: - example-elevator-challenge (elevator-challenge.pollinations.ai) - map-to-isometric (map-to-isometric.pollinations.ai) - product-packaging-designer (product-packaging-designer.pollinations.ai) - virtual-makeup (virtual-makeup.pollinations.ai) All use standard Vite build (npm run build -> dist/) Excluded micro.pollinations.ai (Next.js, different deployment) * 🔒 Replace production Turnstile secrets with placeholders in example files * add myceli one pager prompt (sneaking in) and revert an unnecessary gitignore thing * 🔧 Fix remaining Turnstile issues: logging, CORS, precedence, sed pattern - Remove sensitive token data from logs (only log success/error-codes) - Fix test secret precedence (production first, then test fallback) - Add CORS headers to image API Turnstile errors for consistency - Fix setup-turnstile.sh sed pattern to match actual placeholder - Clean up excessive CI debug logging * 🔧 Restore CI debug logging with TODO for future removal - Keep verbose logging for initial production testing - Added TODO comments to remove once system is stable - Helps troubleshoot deployment issues during rollout * 🔒 Remove production secrets from SESSION_SUMMARY.md documentation * 🔒 Remove ALL remaining production secrets from SESSION_SUMMARY.md - Cloudflare Account ID and Auth Token - Google Analytics API Secret and Measurement ID - Semantic cache tokens - Last remaining Turnstile secret reference * 🗑️ Remove SESSION_SUMMARY.md (contained leaked secrets) * 🔒 Re-encrypt .env files with rotated CLOUDFLARE_AUTH_TOKEN - Updated text.pollinations.ai/.encrypted.env with new token - Re-encrypted image.pollinations.ai/.encrypted.env with latest changes - Old leaked token (Pnizskqc72F...) now invalid - New token (13MK7T96HF...) active and encrypted6 个月前
feat: Add ByteDance ARK Seedream 4.0 image generation model (#4142) - Add new Seedream model with seed tier requirement - Support both text-to-image and image-to-image generation - Support multiple reference images (up to 10) - Support both resolution strings (1K, 2K, 4K) and exact pixel dimensions - Add comprehensive error handling and progress tracking - Clean up gptimage model references for easy reactivation - Add SEEDREAM_API_KEY environment variable documentation Features: - High-quality image generation using Seedream 4.0 - Fast processing (~7-9 seconds) - Up to 4K resolution support - Built-in content filtering - Watermark support - Compatible with existing Pollinations image API7 个月前
Feature/azure content safety (#2219) * Add GPT image prompt and error logging functionality * Enhance GPT image logging with complete userInfo object and debugInfo * Add image parameters logging to capture image URLs and editing requests * Refactor: Move GPT image logging functions to separate utility file * Implement promise caching to prevent duplicate log entries - Added new PromiseCache utility class that caches promises themselves - Updated cacheImage to use promise caching for in-flight requests - This prevents multiple identical requests from starting generation - Duplicate log entries should now be eliminated - Promise cache entries are cleaned up after completion * remove stupod promise cache * Remove unused cacheImage function and outdated tests * Enhance Azure Content Safety integration with improved error handling and logging * Update dependencies and remove LlamaGuard in favor of Azure Content Safety11 个月前
Introduce typescript in image.pollinations.ai (#3261) * Introduce typescript in image.pollinations.ai - Add api tests to verify the enpoint keeps working as expected - Add tsconfig.json - Add zod schema for query params (still unused at this point) - Add fuzz test for zod schema - Move main logic over to typescript * Fix type errors, move testing parameter to .env file * Update package-lock.json after dependency installation * revert createAndReturnImages.ts to the previous working version * Add better logging on test failure in image.pollinations.ai * Fix logging of request body in tests for image.pollinations.ai * Remove zod-fast-check dependency * use the already existing blob --------- Co-authored-by: voodoohop <t.haferlach@gmail.com>9 个月前
Add Dockerfile and .dockerignore to text and image, move affiliates.js into shared (#4656) 6 个月前
Rename image.pollinations.ai service 1 年前
[image.pollinations.ai] Cloudflare Image Caching with Exact URL Matches (#1380) * remove pollinations.diy * initial commit of image cache * Update architecture documentation with Cloudflare Worker and R2 caching setup * update docs and readme * Add GitHub Actions workflow for automatic Cloudflare Worker deployment * fixed paths and timeouts * more metadata1 年前
Move github-auth-simple to auth.pollinations.ai Relocated the github-auth-simple directory from model-context-protocol/github-auth-simple to auth.pollinations.ai in the repo root for better organization as a dedicated auth service.11 个月前
Move github-auth-simple to auth.pollinations.ai Relocated the github-auth-simple directory from model-context-protocol/github-auth-simple to auth.pollinations.ai in the repo root for better organization as a dedicated auth service.11 个月前
Move github-auth-simple to auth.pollinations.ai Relocated the github-auth-simple directory from model-context-protocol/github-auth-simple to auth.pollinations.ai in the repo root for better organization as a dedicated auth service.11 个月前
Move github-auth-simple to auth.pollinations.ai Relocated the github-auth-simple directory from model-context-protocol/github-auth-simple to auth.pollinations.ai in the repo root for better organization as a dedicated auth service.11 个月前
Move github-auth-simple to auth.pollinations.ai Relocated the github-auth-simple directory from model-context-protocol/github-auth-simple to auth.pollinations.ai in the repo root for better organization as a dedicated auth service.11 个月前
Move github-auth-simple to auth.pollinations.ai Relocated the github-auth-simple directory from model-context-protocol/github-auth-simple to auth.pollinations.ai in the repo root for better organization as a dedicated auth service.11 个月前
Add crossdomain.xml files to enable Flash connections (#1289) * Add crossdomain.xml files to enable Flash connections This PR adds crossdomain.xml files to all three domains (pollinations.ai, text.pollinations.ai, and image.pollinations.ai) to enable Flash-based widgets on older devices like Chumby and Sony Dash to connect to the Pollinations API. The file allows Flash applications to make cross-domain requests to these domains, which is necessary for older Flash-based devices to access the LLM text and image services. Closes # 1288 * Add Express routes to serve crossdomain.xml files Updated the implementation to add proper routes in the Express.js servers to serve the crossdomain.xml files for Flash connections: 1. Added a route in text.pollinations.ai/server.js to serve the crossdomain.xml file 2. Added a route in image.pollinations.ai/src/index.js to serve the crossdomain.xml file These changes ensure that Flash applications can properly access the services since the XML files need to be served dynamically by the Express.js servers rather than being static files. * Add tests for crossdomain.xml implementation Added comprehensive tests to verify the crossdomain.xml implementation: 1. For text.pollinations.ai: - Test that crossdomain.xml serves proper XML with correct headers - Test that existing model endpoint still works - Test that text generation still works (no regressions) 2. For image.pollinations.ai: - Test that crossdomain.xml endpoint serves proper XML - Test that existing model endpoint still works These tests help verify that our implementation works correctly and doesn't interfere with existing functionality. * Update crossdomain.test.js --------- Co-authored-by: MentatBot <160964065+MentatBot@users.noreply.github.com> Co-authored-by: voodoohop <t.haferlach@gmail.com>1 年前
Move github-auth-simple to auth.pollinations.ai Relocated the github-auth-simple directory from model-context-protocol/github-auth-simple to auth.pollinations.ai in the repo root for better organization as a dedicated auth service.11 个月前
Rename image.pollinations.ai service 1 年前
Rename image.pollinations.ai service 1 年前
Rename image.pollinations.ai service 1 年前
Rename image.pollinations.ai service 1 年前
Add an AI generated draft of an OpenAPI spec for image.pollinations.ai (#3351) 9 个月前
Add unified usage headers across services (#4638) (#4756) * Add unified token usage headers across text and image services (#4638) - Created shared DRY utility in /shared/registry/usage-headers.ts - Iterates over token types (no boilerplate) - Type-safe with existing TokenUsage type - Supports all 8 token types - Updated image service to use shared utility - Backward compatible headers - Cleaner implementation - Updated text service with usage headers - Non-streaming: Headers sent immediately - Streaming: HTTP trailers sent at end - Transform stream captures usage elegantly Header format: x-usage-{token-type} (kebab-case) Example: x-usage-prompt-text-tokens, x-usage-completion-text-tokens Closes #4638 * Add integration tests for usage headers (Issue #4638) - Image service: 5 tests verifying x-usage-* headers - Text service: 7 tests for non-streaming and streaming responses - Tests verify headers exist and have valid values - All tests passing * Remove temporary documentation files6 个月前
Update GPT Image and NanoBanana pricing (#4830) - GPT Image (gpt-image-1-mini): Add input pricing (.00/1M text, /bin/zsh.20/1M cached, .50/1M image) - NanoBanana: Add input pricing (/bin/zsh.30/1M for text/image inputs) - Update provider metadata: kontext (azure), turbo (scaleway) - Fix image service package.json start script (index.js → index.ts) Verified with local testing - pricing calculations confirmed working correctly.6 个月前
Rename image.pollinations.ai service 1 年前
Rename image.pollinations.ai service 1 年前
Rename image.pollinations.ai service 1 年前
Revert "🚀 Model-Specific Semantic Caching with Vectorize (#2888)" (#3207) This reverts commit f86b63e8125b76c04f60dd2c86e12cae054153ab.9 个月前
[tet.polliations.ai] Feature/update models and server (#1302) * Add Cloudflare tunnel configuration and setup script * Update models configuration, add DeepSeek integration, and enhance server functionality * Merge remote master changes to generateTextPortkey.js * Add Cloudflare tunnel setup scripts1 年前
Rename image.pollinations.ai service 1 年前
🚀 Implement comprehensive nano-banana logging and user stats tracking (#4122) * 🚀 Implement comprehensive nano-banana logging and user stats tracking ✨ New Features: - Added nanoBananaLogger.ts for comprehensive request/response logging - Added userStatsTracker.ts for user statistics with disk persistence - Enhanced vertexAIImageGenerator.ts with user stats integration - Improved vertexAIClient.ts with better error handling and response logging 🔧 Improvements: - Track content policy violations per user - Separate logging for violations vs administrative blocks - Debounced disk writes for performance - Enhanced error response parsing with structured data - Full response logging for debugging content policy issues 📊 Analytics: - User request/violation tracking - Top violators monitoring - Violation rate calculations - Persistent stats across restarts 🛡️ Safety: - Better content policy violation detection - Structured logging for moderation analysis - User identification for policy enforcement - Administrative vs policy violation distinction �� Files: - NEW: image.pollinations.ai/src/utils/nanoBananaLogger.ts - NEW: image.pollinations.ai/src/utils/userStatsTracker.ts - NEW: image.pollinations.ai/test-blocked-users.js - MODIFIED: image.pollinations.ai/src/vertexAIImageGenerator.ts - MODIFIED: image.pollinations.ai/src/vertexAIClient.ts - MODIFIED: image.pollinations.ai/src/models.ts * 🔧 Enhance Nano Banana safety system - Add 25-second timeout to Vertex AI API requests to prevent hanging - Update Nano Banana prefix to include explicit safety instructions - Improve error handling for timeout scenarios - Ensure safety-first approach in image generation prompts7 个月前
🔧 Fix p-queue interval issue and set seedream to 45s intervals (#4158) * Add reference image support for image models * Refactor: Remove debug logging and extract TextField styling - Remove console.log from line 126 in ImageEditor.js - Extract TextField styling to TEXT_FIELD_STYLES constant for reusability - Improve code maintainability and eliminate debug output Co-authored-by: voodoohop <voodoohop@users.noreply.github.com> * fix comma separator. introduce | - because urls can have commas * 🔧 Fix p-queue interval issue and set seedream to 45s intervals - Fix p-queue intervalCap issue in shared/ipQueue.js - Add intervalCap: 1 when interval > 0 to make intervals work - Without intervalCap, p-queue ignores interval parameter - Update seedream model to use 45-second intervals - Changed from 30s to 45s for better rate limiting - forceCap: true ensures cap=1 regardless of user tier - Add test scripts for debugging p-queue behavior - test_pqueue_behavior.js: Tests interval timing behavior - test_parallel_images.sh: Tests real-world queue behavior Fixes queue intervals for seedream model - now properly enforces 45-second spacing between requests for all users. * 🔧 Update nanobanana to 45s intervals for consistency with seedream - Both nanobanana and seedream now use 45-second intervals - Ensures consistent rate limiting across premium image models - Maintains forceCap: true for both models --------- Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com> Co-authored-by: voodoohop <voodoohop@users.noreply.github.com>7 个月前
🔧 Fix p-queue interval issue and set seedream to 45s intervals (#4158) * Add reference image support for image models * Refactor: Remove debug logging and extract TextField styling - Remove console.log from line 126 in ImageEditor.js - Extract TextField styling to TEXT_FIELD_STYLES constant for reusability - Improve code maintainability and eliminate debug output Co-authored-by: voodoohop <voodoohop@users.noreply.github.com> * fix comma separator. introduce | - because urls can have commas * 🔧 Fix p-queue interval issue and set seedream to 45s intervals - Fix p-queue intervalCap issue in shared/ipQueue.js - Add intervalCap: 1 when interval > 0 to make intervals work - Without intervalCap, p-queue ignores interval parameter - Update seedream model to use 45-second intervals - Changed from 30s to 45s for better rate limiting - forceCap: true ensures cap=1 regardless of user tier - Add test scripts for debugging p-queue behavior - test_pqueue_behavior.js: Tests interval timing behavior - test_parallel_images.sh: Tests real-world queue behavior Fixes queue intervals for seedream model - now properly enforces 45-second spacing between requests for all users. * 🔧 Update nanobanana to 45s intervals for consistency with seedream - Both nanobanana and seedream now use 45-second intervals - Ensures consistent rate limiting across premium image models - Maintains forceCap: true for both models --------- Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com> Co-authored-by: voodoohop <voodoohop@users.noreply.github.com>7 个月前
Restructure monorepo with shared TypeScript registry and tsx runtime (#4389) * Enable tsx imports from shared/registry in text & image services Fixes #4244 ## Changes ### Text Service (text.pollinations.ai) - Add tsx and typescript as dev dependencies - Update npm scripts to use tsx instead of node - Add tsconfig.json with loose TypeScript config - Enable importing .ts files from ../shared/registry/ ### Image Service (image.pollinations.ai) - Update tsconfig.json to use moduleResolution: bundler - Add ../shared/**/*.ts to includes - Enable importing .ts files from ../shared/registry/ ### Shared Registry - Add shared/registry/ with TypeScript model definitions - Add shared/tsconfig.json for shared TypeScript config - Add shared/utils.ts for utility functions ## Benefits - Zero build step - tsx transpiles on-the-fly - Services can now import TypeScript registry files directly - No type checking overhead (loose mode) - Enables code sharing between services - Foundation for centralizing model configs ## Testing - ✅ Text service starts with npm start - ✅ Image service can import registry - ✅ All TypeScript imports working * Migrate enter.pollinations.ai to use shared registry - Remove local registry files (image.ts, text.ts, registry.ts, price-helpers.ts) - Update imports to use ../shared/registry/ - Update schemas and middleware to use shared registry - Update tsconfig.json to include shared TypeScript files - Update package dependencies * Fix enter.pollinations.ai imports to use @shared alias - Add @shared/* path alias to tsconfig.json - Update all imports from ../../shared/ to @shared/ - Update test files to use @shared/ imports - Fix Vitest module resolution for shared registry Result: 3/4 test suites passing (models.test.ts timeouts unrelated to tsx migration) * Move registry tests to shared folder and set up vitest - Moved test/registry.test.ts from enter.pollinations.ai to shared/test/ - Registry tests only test shared registry code, no enter-specific logic - Added vitest.config.ts with simple Node.js test setup - Updated package.json with test scripts and vitest dependency - Updated test imports to use relative paths (../registry/*) - All 7 tests passing * Add vitest types to tsconfig to fix lint errors7 个月前
Introduce typescript in image.pollinations.ai (#3261) * Introduce typescript in image.pollinations.ai - Add api tests to verify the enpoint keeps working as expected - Add tsconfig.json - Add zod schema for query params (still unused at this point) - Add fuzz test for zod schema - Move main logic over to typescript * Fix type errors, move testing parameter to .env file * Update package-lock.json after dependency installation * revert createAndReturnImages.ts to the previous working version * Add better logging on test failure in image.pollinations.ai * Fix logging of request body in tests for image.pollinations.ai * Remove zod-fast-check dependency * use the already existing blob --------- Co-authored-by: voodoohop <t.haferlach@gmail.com>9 个月前
Rename image.pollinations.ai service 1 年前