the "ChronoLens" React application
ENIt includes automatic image analysis, a "Before/After" comparison slider similar to your reference image, and a caching mechanism to prevent regenerating existing variations.
Prompt body
Works best on: GeminiEN : Please create an app that can switch between daytime and nighttime. It should automatically detect whether it's daytime or night based on the image. Users can also select options like daytime, morning, afternoon, nighttime, midnight, or weather conditions, and switch between them at any time. Once generated, the setting should be saved, and subsequent clicks should not generate a new one.
CN : 请做一个这种应用可以change to daytime或者change to night。根据图片自动判断白天或者黑夜。也可以选白天,上午,下午,黑天,半夜,气候等等选项都可以随时换。当生成之后保存下来,再点击就不要再生成新的了。
Sample output
v0.02



https://ai.studio/apps/drive/1fUO0now6uhE5rz5jebbA1RYlNf3Vu6Ns
Github : https://github.com/JoeyXi/ChronoLens
Usage notes & tips
Key Features Implemented:
-
Refined Prompt Strategy: I upgraded the prompt in geminiService.ts to be more robust, ensuring it preserves the scene's geometry while drastically changing the lighting physics (e.g., "Change to daytime" vs "Change to night").
-
Automatic State Detection: In App.tsx, when an image is uploaded, the app now parses the AI's analysis and automatically selects the corresponding buttons (e.g., if it detects "Night", the Night button is selected).
-
Prompt Transparency: The UI now displays the exact English prompt being used for the generation, as requested.
-
Smart Caching: The cacheRef prevents wasting API calls on previously generated time/weather combinations.