Latent Flow Matching Image Generator
Live Demo: Check it out here
Source Code: Github
What it does
We built a generative image model from scratch using Latent Flow Matching. By combining a Variational Autoencoder (VAE) with a lightweight MLP velocity predictor and vanilla classifier-free guidance, our model can effectively sample and generate clean images that capture the underlying MNIST data distribution.
How we built it
- Model Architecture & Training: We built both the VAE and the MLP velocity network completely from scratch, writing a custom training loop to learn the MNIST data distribution.
- Compute: We leveraged Hyak Klone (high-performance computing resources) to train the model and extract our final model weights.
- Full-Stack Interface: We developed a web interface backed by a Flask server that bridges the frontend (HTML/CSS/JS) with our backend model, allowing users to interactively prompt and generate images seamlessly.
Challenges we ran into
- Compute & Time Constraints: Training deep generative models from scratch always eats up precious hackathon hours, leaving little room for hyperparameter tuning.
- Integration Overhead: Wiring up the Flask backend with asynchronous JavaScript and HTML front-end communication took a significant chunk of time away from core model experimentation.
Accomplishments that we're proud of
Successfully training a custom flow-matching model from scratch on cluster compute and wiring the entire pipeline, from raw GPU weights to a live, interactive web demo.
What we learned
We gained a deep, hands-on understanding of how to set up robust Flask servers and manage stateful, asynchronous communication loops between Flask <-> JavaScript <-> HTML.
What's next for Latent Flow Matching
- Scaling Up: Transitioning from our lightweight MLP to a Multimodal Diffusion Transformer (MMDiT) architecture to handle general, high-resolution imagery.
- Cloud Infrastructure: Shifting compute entirely to scalable cloud instances rather than local web execution to handle larger parameter sizes and deliver a lightning-fast, state-of-the-art user experience.
Log in or sign up for Devpost to join the conversation.