Overexposure: graduated float instead of boolean#4
Open
marcelo-earth wants to merge 8 commits into
Open
Conversation
Change the overexposure model from a simple on/off toggle to a graduated float (0.0–1.0) for finer control over how washed out the generated document photo appears.
Include overexposure intensity and a human-readable description in the failure_modes section of the prompt JSON so Gemini knows how washed out to render the document photo. Also surface shadow_band which was previously missing from the prompt.
New preset combines 0.7 overexposure with strong center glare to simulate a document photographed under harsh direct lighting, a common failure mode in warehouse environments.
When a field is illegible and the variation has overexposure > 0, the manifest now explains the failure as washed_out_by_overexposure with the intensity value so downstream consumers can distinguish intentional degradation from image gen errors.
Replace the boolean overexposed_patch field with the new float overexposure field in the Gemini schema prompt so natural language descriptions like 'slightly washed out' map to appropriate intensity values.
Sync documentation and command reference with the new graduated overexposure field across variations.mdx, sdk/variation.mdx, and the penquify command template.
Cover the default (no overexposure), all three intensity tiers (light/moderate/severe), prompt JSON serialization, and the new overexposed preset.
Verify that when a field is illegible and the variation has overexposure set, the manifest includes the correct reason string with the intensity value.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
overexposed_patchwas a bool — on or off, no middle ground. Replaced it withoverexposure: float(0.0–1.0) so you can control how washed out the photo gets.The float maps to a description in the Gemini prompt: ≤0.3 is "light wash", ≤0.6 is "moderate bleaching", above that is "severely washed out, text barely visible."
Also:
Test plan
--presets overexposed, confirm it looks washed outtext_to_variation("slightly overexposed document")should map to a low float