Skip to content

[AI] Add Hybrid Image Pattern Finder sample - #2854

Open
rlazo wants to merge 4 commits into
masterfrom
rl.new.hybrid.case
Open

rlazo wants to merge 4 commits into
masterfrom
rl.new.hybrid.case

Conversation

@rlazo

@rlazo rlazo commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

Introduce the Hybrid Image Pattern Finder sample to compare two images
and identify shared patterns using hybrid generative AI inference.

  • Add: HybridImagePatternViewModel and HybridImagePatternUiState
    to handle model status checking, downloading, downsampled image
    decoding, and multi-modal content generation.
  • Create: HybridImagePatternScreen with Compose UI for selecting
    images via camera or photo picker, choosing inference modes, and
    viewing analysis results.
  • Register: ScreenType.HYBRID_IMAGE_PATTERN and configure routing in
    FirebaseAISamples and MainActivity.

rlazo added 2 commits October 22, 2026 10:57
Introduce the Hybrid Image Pattern Finder sample to compare two images
and identify shared patterns using hybrid generative AI inference.

* Add: `HybridImagePatternViewModel` and `HybridImagePatternUiState`
to handle model status checking, downloading, downsampled image
decoding, and multi-modal content generation.
* Create: `HybridImagePatternScreen` with Compose UI for selecting
images via camera or photo picker, choosing inference modes, and
viewing analysis results.
* Register: `ScreenType.HYBRID_IMAGE_PATTERN` and configure routing in
`FirebaseAISamples` and `MainActivity`.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request enables parallel sync for Gradle 9.4+ across multiple modules and introduces a new 'Hybrid Image Pattern Finder' feature in the firebase-ai sample app, allowing users to compare two images and find common patterns using Gemini. Feedback on the implementation highlights two key issues: first, the use of explicit backing fields for uiState in HybridImagePatternViewModel will cause compilation errors because StateFlow does not support the update extension function; second, using TakePicturePreview() in HybridImagePatternScreen returns a low-resolution thumbnail that degrades image analysis quality, so switching to TakePicture() with a temporary file Uri is recommended.

@rlazo
rlazo requested a review from VinayGuthal October 30, 2026 18:28
@VinayGuthal

Copy link
Copy Markdown
Contributor

Tests are failing

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