
OminiKontext is a training framework that teaches Flux.1-Kontext-dev how to intelligently combine two input images. Unlike traditional approaches that alter model architecture, OminiKontext leverages 3D RoPE embeddings to achieve precise reference-based image fusion with any type of content.
The framework enables users to train custom LoRA models that can seamlessly blend reference objects, products, characters, or clothing into target scenes. Whether you're working with e-commerce products, virtual try-on applications, or creative content generation, OminiKontext provides the tools to teach Kontext exactly how to merge your specific use case.
๐ Live Demo Available on Replicate
๐ GitHub Repository
๐ ๏ธ ComfyUI Integration & Workflows
๐ฌ Video Demo on Github
The key innovation in Flux.1-Kontext lies in its 3D RoPE embedding system, which fundamentally changes how images are processed compared to standard Flux.1-dev:
Standard Flux.1-dev: Uses 2D RoPE embeddings where image tokens are arranged in a simple 2D grid (width ร height).
Flux.1-Kontext: Introduces a third dimension creating layered token spaces (width ร height ร layers), similar to Photoshop's layer system. This allows multiple images to exist in separate layers that can be precisely controlled and blended.
OminiKontext leverages this 3D architecture through its delta coordinate system that provides unprecedented control:
delta = [L, Y, X]
Where:
delta = [L, Yp // 16, Xp // 16] where Yp, Xp are pixel coordinatesKey Mechanism:
[1, 0, 0][L+1, Y, X] for layer separationSpatial Control (delta = [1, Y, X]):
delta = [1, 0, (base_width - subject_width) // 16] for right-edge placementNon-Spatial Control (delta = [0, 0, 96]):
Traditional approaches stitch images horizontally or vertically, which:
OminiKontext's delta system:
OminiKontext demonstrates versatile capability across different domains:
When compared to vanilla FLUX.1-Kontext-dev, OminiKontext shows significant improvements in:
OminiKontext comes with several example models showcasing different training approaches. These serve as both functional tools and training references for your custom models:
[0,0,96][1,0,0][0,0,96]Note: These models demonstrate the framework's versatility. You can train similar models for clothing (VTON), furniture, vehicles, or any object category using the same methodology.
Refer to the installation guide for detailed instructions on how to get started.