Skip to content

fix: permissive bugfixes and FLUX image generation#17

Merged
seanfromthepast merged 3 commits intomainfrom
fix/permissive-fixes-and-flux
Mar 12, 2026
Merged

fix: permissive bugfixes and FLUX image generation#17
seanfromthepast merged 3 commits intomainfrom
fix/permissive-fixes-and-flux

Conversation

@realityinspector
Copy link
Collaborator

Summary

  • 422 pass-through: sync endpoint's generic except Exception was swallowing the 422 HTTPException from permissive policy validation, returning 500 instead
  • Image fallback fix: google/gemini-2.5-flash-image-preview doesn't exist on OpenRouter (404). Schema tolerance for ImagePromptOptimizerOutput.issues_found (DeepSeek returns strings instead of objects, causing retry storms)
  • FLUX for permissive images: default permissive image model is now black-forest-labs/flux.2-pro via OpenRouter. Add black-forest-labs/ to PERMISSIVE_PREFIXES and OPENROUTER_PREFIXES. OpenRouter provider sends modalities: ["image"] for FLUX (image-only models)

Test plan

  • model_policy=permissive with image uses FLUX via OpenRouter
  • Proprietary model rejection returns 422 (not 500)
  • Commercial Google path unaffected
  • pytest -m fast passes

The sync endpoint's broad except-Exception handler was swallowing the
422 HTTPException from resolve_model_policy() and re-wrapping it as 500.
- Use google/gemini-2.5-flash-image (exists on OpenRouter) instead of
  -preview variant (404) when no open-weight image models available
- Accept string or PromptIssue in ImagePromptOptimizerOutput.issues_found
  to avoid retry storms when DeepSeek returns plain strings
…neration

- Default permissive image model is now FLUX.2 Pro via OpenRouter
- Add black-forest-labs/ to PERMISSIVE_PREFIXES and OPENROUTER_PREFIXES
- OpenRouter provider sends modalities: ["image"] for FLUX models
  (image-only models don't support ["image", "text"])
- Update downstream docs with FLUX as permissive image default
@seanfromthepast seanfromthepast merged commit c66c89c into main Mar 12, 2026
1 of 3 checks passed
realityinspector pushed a commit that referenced this pull request Mar 15, 2026
* fix: let HTTPException (422) pass through sync endpoint's generic catch

The sync endpoint's broad except-Exception handler was swallowing the
422 HTTPException from resolve_model_policy() and re-wrapping it as 500.

* fix: permissive image fallback and optimizer schema tolerance

- Use google/gemini-2.5-flash-image (exists on OpenRouter) instead of
  -preview variant (404) when no open-weight image models available
- Accept string or PromptIssue in ImagePromptOptimizerOutput.issues_found
  to avoid retry storms when DeepSeek returns plain strings

* feat: use FLUX (black-forest-labs/flux.2-pro) for permissive image generation

- Default permissive image model is now FLUX.2 Pro via OpenRouter
- Add black-forest-labs/ to PERMISSIVE_PREFIXES and OPENROUTER_PREFIXES
- OpenRouter provider sends modalities: ["image"] for FLUX models
  (image-only models don't support ["image", "text"])
- Update downstream docs with FLUX as permissive image default
@realityinspector realityinspector deleted the fix/permissive-fixes-and-flux branch March 15, 2026 14:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants