Requires OpenAI, Managed AI, or Google. Favicon generation uses image-to-image (reference image) APIs — OpenAI's
/v1/images/edits(which the Managed proxy forwards) and Google Gemini's multimodalgenerateContent. fal.ai and Anthropic (Claude) do not support it. The gate isAiImageGenerator::supportsReferenceImages(); configure your provider at Dashboard → Settings → AI.
How it works
- Upload a light logo via Dashboard → Settings → Branding → Logo.
- In the Favicon section, click Generate with AI (sparkles button).
- WebProCMS sends the logo to the configured provider's image-editing endpoint with a prompt instructing it to extract the primary graphic symbol, remove any full wordmark or tagline text, and center it on a solid brand-colored background at 1024×1024 (square).
- The result is saved to the media library under the Logos category with auto-generated alt text.
- The new favicon is set immediately — no manual picker step required.
The operator can discard the result by clicking Remove or Change favicon to pick a different image from the media library.
Provider support
| Provider | Reference image support | Notes |
|---|---|---|
| OpenAI | ✅ | Uses /v1/images/edits (multipart) with the configured image model (ai.openai_image_model, default gpt-image-2.5-flare). Size forced to 1024x1024. |
| Managed AI | ✅ | Same OpenAI dialect, forwarded through the mothership proxy on your license key — no image API key of your own. |
| Google Gemini | ✅ | Uses generateContent with inline_data alongside the text prompt. Gemini 2.0 Flash Image and 2.5 Flash Image both support multimodal input. Always returns PNG; extension reconciled after generation. |
| fal.ai | ❌ | Has a separate img2img endpoint not yet integrated. |
| Anthropic (Claude) | ❌ | Claude is a text/vision model only — it can analyze images as input but Anthropic has no image generation API. Not possible with Claude. |
Output format and sizing
The favicon is generated at 1024×1024 regardless of the operator's global size setting (which defaults to landscape for page images). The square aspect is forced so the output is always suitable for browser tab display.
- OpenAI: format follows the operator's Output Format setting (WebP default, with server-side PNG→WebP conversion since
gpt-image-2ignoresoutput_format: webp). - Google: always returns PNG; the file extension is reconciled automatically after generation.
Sized favicon set (automatic)
Whenever a custom favicon is set — AI-generated, picked from the library, or replaced via the media library's Replace file — the CMS derives a full sized icon set from the single upload (App\Support\FaviconVariants): square, transparent-padded PNGs at 16 / 32 / 48 (browser tabs), 180 (Apple touch icon), and 192 / 512 (Android + web app manifest, served at /site.webmanifest). Sizes larger than the source image are skipped — nothing is ever upscaled — so uploading a square image of 512×512 or larger yields the complete set. Variants live under public/favicons/{fingerprint}/; the fingerprint changes with the source bytes, so replacements bust every cache automatically.
The head renders each variant with a truthful sizes attribute:
<link rel="icon" type="image/png" sizes="16x16" href="/favicons/{fp}/favicon-16.png">
<link rel="icon" type="image/png" sizes="32x32" href="/favicons/{fp}/favicon-32.png">
<link rel="icon" type="image/png" sizes="48x48" href="/favicons/{fp}/favicon-48.png">
<link rel="icon" type="image/png" sizes="192x192" href="/favicons/{fp}/favicon-192.png">
<link rel="apple-touch-icon" sizes="180x180" href="/favicons/{fp}/favicon-180.png">
<link rel="manifest" href="/site.webmanifest">
SVG favicons are linked directly with type="image/svg+xml" (vectors scale losslessly in tabs); PNG variants are still generated from a rasterized copy when the Imagick extension is available, covering Apple touch and manifest consumers that ignore SVG.
Fallback behavior
When no custom favicon is set, the public site falls back to the static files at public/favicon.ico and public/favicon.svg. When a custom favicon is set but its sized variants haven't been generated yet (they're backfilled by a migration on update, and regenerated on every branding save), the head serves the raw upload URL as a single icon + apple-touch-icon pair.
Operator checklist
- API key configured for OpenAI or Google (Settings → API Keys)
- Image provider set to OpenAI or Google (Settings → API Keys)
- Light logo uploaded (Settings → Branding → Logo) — the button is hidden when no logo is set