$ show dangeng/visual_anagrams
This repository is an application for generating multi-view optical illusions (visual anagrams) using diffusion models. It enables users to create images that transform into different appearances when subjected to operations like rotation, flipping, jigsaw rearrangement, or other transformations. The system leverages pre-trained DeepFloyd IF diffusion models and applies custom 'views' during the denoising process to encode different transformations into the same image. Key components include argument handling, a two-stage sampling process that applies view transformations to noise predictions, and specialized view implementations for various image transformations. The application can generate images at multiple resolutions and create animations showing the transformation between views.
The LLM identified 2 files worth highlighting for reuse:
Implements a sophisticated 4x4 jigsaw puzzle transformation with piece extraction, permutation logic, and spline-based animation. The component handles complex logic for dividing images into puzzle pieces, generating valid permutations, and animating the transition with smooth motion paths. It demonstrates non-obvious skill in computational geometry and animation techniques, and could be extracted for use in other projects requiring jigsaw-like transformations or permutation-based image manipulations with minimal modification (requiring only the base view class and standard dependencies).
Implements a motion blur transformation that creates realistic trailing effects by averaging multiple frames. The component uses a frame buffering technique to simulate motion and generates smooth animations with temporal coherence. It demonstrates non-obvious skill in simulating realistic motion blur through computational techniques rather than simple blurring, and could be reused in other projects needing motion effects or temporal image transformations with only the base view and standard ML/image processing dependencies.