[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-78255":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":17,"stars7d":18,"stars30d":19,"stars90d":16,"forks30d":16,"starsTrendScore":20,"compositeScore":21,"rankGlobal":10,"rankLanguage":10,"license":22,"archived":23,"fork":23,"defaultBranch":24,"hasWiki":25,"hasPages":23,"topics":26,"createdAt":10,"pushedAt":10,"updatedAt":27,"readmeContent":28,"aiSummary":29,"trendingCount":16,"starSnapshotCount":16,"syncStatus":30,"lastSyncTime":31,"discoverSource":32},78255,"Lens","microsoft\u002FLens","microsoft","Lens is a 3.8B-parameter text-to-image diffusion model that achieves quality competitive with and in several cases surpassing models like FLUX and SD3, while requiring significantly less training compute. Key ideas include maximizing data information density per batch and accelerating convergence. ","",null,"Python",234,16,1,6,0,5,10,199,15,3.69,"MIT License",false,"main",true,[],"2026-06-12 02:03:46","\u003Cdiv align=\"center\">\n\n# Lens: Rethinking Training Efficiency for Foundational Text-to-Image Models\n\n\u003Cimg src=\"assets\u002Fteaser.webp\" alt=\"Lens Teaser\" width=\"100%\" \u002F>\n\n\u003Cp>\n  \u003Cb>Contributors (Alphabetical Order):\u003C\u002Fb>\u003Cbr \u002F>\n    \u003Cstrong>Baining Guo\u003C\u002Fstrong>,\n    \u003Cstrong>Chong Luo\u003C\u002Fstrong>,\n    \u003Cstrong>Dong Chen\u003C\u002Fstrong>&dagger;,\n    \u003Cstrong>Dongdong Chen\u003C\u002Fstrong>,\n    \u003Cstrong>Fangyun Wei\u003C\u002Fstrong>&dagger;,\n    \u003Cstrong>Ji Li\u003C\u002Fstrong>,\n    \u003Cstrong>Jianmin Bao\u003C\u002Fstrong>,\n    \u003Cstrong>Jiawei Zhang\u003C\u002Fstrong>&ast;,\n    \u003Cstrong>Jinjing Zhao\u003C\u002Fstrong>&ast;,\n    \u003Cstrong>Lei Shi\u003C\u002Fstrong>,\n    \u003Cstrong>Qinhong Yang\u003C\u002Fstrong>,\n    \u003Cstrong>Sirui Zhang\u003C\u002Fstrong>&ast;,\n    \u003Cstrong>Xiuyu Wu\u003C\u002Fstrong>,\n    \u003Cstrong>Xuelu Feng\u003C\u002Fstrong>,\n    \u003Cstrong>Yan Lu\u003C\u002Fstrong>,\n    \u003Cstrong>Yanchen Dong\u003C\u002Fstrong>,\n    \u003Cstrong>Yang Yue\u003C\u002Fstrong>&ast;,\n    \u003Cstrong>Yitong Wang\u003C\u002Fstrong>,\n    \u003Cstrong>Yunuo Chen\u003C\u002Fstrong>,\n    \u003Cstrong>Zhiyang Liang\u003C\u002Fstrong>&ast;,\n    \u003Cstrong>Ziyu Wan\u003C\u002Fstrong>&dagger;\n  \u003Cbr \u002F>\n  Microsoft &nbsp;|&nbsp; &ast;Core Contributors &nbsp;|&nbsp; &dagger;Project Lead\n\u003C\u002Fp>\n\n\u003Cp>\n  \u003Ca href=\"https:\u002F\u002Farxiv.org\u002Fabs\u002F2605.21573\">\u003Cimg alt=\"arXiv\" src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FarXiv-Paper-b31b1b?logo=arxiv&logoColor=white\" height=\"22\" \u002F>\u003C\u002Fa>\n  &nbsp;\n  \u003Ca href=\"https:\u002F\u002Fhuggingface.co\u002Fmicrosoft\u002FLens\">\u003Cimg alt=\"Hugging Face\" src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002F%F0%9F%A4%97-Models-yellow\" height=\"22\" \u002F>\u003C\u002Fa>\n  &nbsp;\n  \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002FLens\">\u003Cimg alt=\"GitHub\" src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FGitHub-Repo-181717?logo=github&logoColor=white\" height=\"22\" \u002F>\u003C\u002Fa>\n  &nbsp;\n  \u003Ca href=\"LICENSE\">\u003Cimg alt=\"License: MIT\" src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FLicense-MIT-green.svg\" height=\"22\" \u002F>\u003C\u002Fa>\n\u003C\u002Fp>\n\n\u003C\u002Fdiv>\n\n---\n\n**Lens** is a **3.8B-parameter** foundational text-to-image model designed for **efficient training** and **fast high-resolution generation**. It combines dense-caption pre-training, mixed-resolution learning, GPT-OSS multi-layer text features, and the FLUX.2 semantic VAE to reach competitive quality with substantially less training compute than larger T2I models.\n\nThis repository provides the minimal inference code for generating images from Lens DiT checkpoints.\n\n## Highlights\n\n- **Efficient Foundation** &mdash; Trained on **Lens-800M**, an 800M image-text corpus with long GPT-4.1 captions, maximizing information density per training batch.\n- **Compact & Expressive** &mdash; A 48-block MMDiT denoiser leverages FLUX.2 latents and concatenated multi-layer GPT-OSS features for stronger prompt following and multilingual generalization.\n- **Flexible Resolution** &mdash; Mixed-resolution training enables inference across aspect ratios from `1:2` to `2:1` and resolutions up to **1440&times;1440**.\n- **Post-trained Variants** &mdash; RL tuning improves visual quality and artifact suppression; the distilled **Lens-Turbo** supports fast **4-step** generation.\n\n## Gallery\n\n\u003C!-- LENS_GALLERY_START -->\n\n\u003Cdetails name=\"lens-gallery\" open>\n  \u003Csummary>\u003Cb>Page 1 \u002F 6\u003C\u002Fb> &nbsp; samples 000-005\u003C\u002Fsummary>\n\n\u003Ctable>\n  \u003Ctr>\n    \u003Ctd width=\"33%\" valign=\"top\">\n      \u003Cimg src=\"assets\u002Fgallery\u002F000-1440x1440.png\" alt=\"Lens gallery sample 000\" width=\"100%\" \u002F>\n      \u003Cbr \u002F>\n      \u003Csub>\u003Cb>Sample 000\u003C\u002Fb> &middot; 1440x1440\u003Cbr \u002F>A generous portion of classic British fish and chips served on a sheet of white paper, golden crispy beer-battered cod fillet alongside thick-cut chips, a wedge of lemon, mushy peas in a small dish, malt vinegar bottle nearby, wooden pub table, overhead shot\u003C\u002Fsub>\n    \u003C\u002Ftd>\n    \u003Ctd width=\"33%\" valign=\"top\">\n      \u003Cimg src=\"assets\u002Fgallery\u002F001-1440x1440.png\" alt=\"Lens gallery sample 001\" width=\"100%\" \u002F>\n      \u003Cbr \u002F>\n      \u003Csub>\u003Cb>Sample 001\u003C\u002Fb> &middot; 1440x1440\u003Cbr \u002F>The iconic Big Ben clock tower and the Houses of Parliament in London at golden hour, the River Thames reflecting warm amber light, Westminster Bridge in the foreground, a classic red double-decker bus crossing, dramatic clouds lit by sunset\u003C\u002Fsub>\n    \u003C\u002Ftd>\n    \u003Ctd width=\"33%\" valign=\"top\">\n      \u003Cimg src=\"assets\u002Fgallery\u002F002-1440x1440.png\" alt=\"Lens gallery sample 002\" width=\"100%\" \u002F>\n      \u003Cbr \u002F>\n      \u003Csub>\u003Cb>Sample 002\u003C\u002Fb> &middot; 1440x1440\u003Cbr \u002F>La Tour Eiffel au cr&#233;puscule vue depuis le Trocad&#233;ro, la structure en fer illumin&#233;e de milliers de lumi&#232;res dor&#233;es scintillantes, le ciel passant du bleu profond au violet, les fontaines du Trocad&#233;ro au premier plan avec des reflets dor&#233;s, silhouettes de promeneurs\u003C\u002Fsub>\n    \u003C\u002Ftd>\n  \u003C\u002Ftr>\n  \u003Ctr>\n    \u003Ctd width=\"33%\" valign=\"top\">\n      \u003Cimg src=\"assets\u002Fgallery\u002F003-1248x1664.png\" alt=\"Lens gallery sample 003\" width=\"100%\" \u002F>\n      \u003Cbr \u002F>\n      \u003Csub>\u003Cb>Sample 003\u003C\u002Fb> &middot; 1248x1664\u003Cbr \u002F>A crystal dragon soaring through an aurora borealis sky, its entire body made of transparent faceted crystal refracting the green and purple aurora light into rainbow spectra, ice particles trailing from its wings, high fantasy digital art\u003C\u002Fsub>\n    \u003C\u002Ftd>\n    \u003Ctd width=\"33%\" valign=\"top\">\n      \u003Cimg src=\"assets\u002Fgallery\u002F004-1664x1248.png\" alt=\"Lens gallery sample 004\" width=\"100%\" \u002F>\n      \u003Cbr \u002F>\n      \u003Csub>\u003Cb>Sample 004\u003C\u002Fb> &middot; 1664x1248\u003Cbr \u002F>Aerial view of Yuanyang rice terraces in Yunnan province at sunrise, thousands of cascading water-filled paddies reflecting golden and pink sky colors, morning mist weaving between terrace layers, lush green hillside with scattered palm trees, drone photography\u003C\u002Fsub>\n    \u003C\u002Ftd>\n    \u003Ctd width=\"33%\" valign=\"top\">\n      \u003Cimg src=\"assets\u002Fgallery\u002F005-1664x1248.png\" alt=\"Lens gallery sample 005\" width=\"100%\" \u002F>\n      \u003Cbr \u002F>\n      \u003Csub>\u003Cb>Sample 005\u003C\u002Fb> &middot; 1664x1248\u003Cbr \u002F>A green iguana basking on a moss-covered fallen log in a tropical rainforest, every scale and spine rendered in sharp detail, dewdrops clinging to its skin, a blurred waterfall and lush tropical foliage in the background, National Geographic wildlife photography style\u003C\u002Fsub>\n    \u003C\u002Ftd>\n  \u003C\u002Ftr>\n\u003C\u002Ftable>\n\u003C\u002Fdetails>\n\n\u003Cdetails name=\"lens-gallery\">\n  \u003Csummary>\u003Cb>Page 2 \u002F 6\u003C\u002Fb> &nbsp; samples 006-011\u003C\u002Fsummary>\n\n\u003Ctable>\n  \u003Ctr>\n    \u003Ctd width=\"33%\" valign=\"top\">\n      \u003Cimg src=\"assets\u002Fgallery\u002F006-1248x1664.png\" alt=\"Lens gallery sample 006\" width=\"100%\" \u002F>\n      \u003Cbr \u002F>\n      \u003Csub>\u003Cb>Sample 006\u003C\u002Fb> &middot; 1248x1664\u003Cbr \u002F>Oil painting portrait of a Renaissance noblewoman in a deep blue velvet dress with pearl drop earrings, soft chiaroscuro lighting revealing delicate skin, craquelure texture on the painted surface, in the style of Vermeer\u003C\u002Fsub>\n    \u003C\u002Ftd>\n    \u003Ctd width=\"33%\" valign=\"top\">\n      \u003Cimg src=\"assets\u002Fgallery\u002F007-1440x1440.png\" alt=\"Lens gallery sample 007\" width=\"100%\" \u002F>\n      \u003Cbr \u002F>\n      \u003Csub>\u003Cb>Sample 007\u003C\u002Fb> &middot; 1440x1440\u003Cbr \u002F>An artisan honey jar with a hand-illustrated vintage botanical label reading &quot;Mountain Wildflower Honey&quot; in brown serif letterpress-style typography with decorative flourishes, detailed ink drawings of wildflowers, clover and honeybees surrounding the text, kraft paper label on clear glass jar\u003C\u002Fsub>\n    \u003C\u002Ftd>\n    \u003Ctd width=\"33%\" valign=\"top\">\n      \u003Cimg src=\"assets\u002Fgallery\u002F008-1440x1440.png\" alt=\"Lens gallery sample 008\" width=\"100%\" \u002F>\n      \u003Cbr \u002F>\n      \u003Csub>\u003Cb>Sample 008\u003C\u002Fb> &middot; 1440x1440\u003Cbr \u002F>Watercolor portrait of a thoughtful young man reading a worn leather book in a Parisian cafe, loose wet-on-wet brushstrokes bleeding into warm amber and burnt sienna washes, visible paper grain texture\u003C\u002Fsub>\n    \u003C\u002Ftd>\n  \u003C\u002Ftr>\n  \u003Ctr>\n    \u003Ctd width=\"33%\" valign=\"top\">\n      \u003Cimg src=\"assets\u002Fgallery\u002F009-1664x1248.png\" alt=\"Lens gallery sample 009\" width=\"100%\" \u002F>\n      \u003Cbr \u002F>\n      \u003Csub>\u003Cb>Sample 009\u003C\u002Fb> &middot; 1664x1248\u003Cbr \u002F>An explorer&#x27;s oak desk with an aged world map spread open, a brass sextant, leather-bound navigation journal with handwritten entries, melting candle in a copper holder, scattered compass and quill pen, warm window light, still life photography\u003C\u002Fsub>\n    \u003C\u002Ftd>\n    \u003Ctd width=\"33%\" valign=\"top\">\n      \u003Cimg src=\"assets\u002Fgallery\u002F010-1664x1248.png\" alt=\"Lens gallery sample 010\" width=\"100%\" \u002F>\n      \u003Cbr \u002F>\n      \u003Csub>\u003Cb>Sample 010\u003C\u002Fb> &middot; 1664x1248\u003Cbr \u002F>New York Grand Central Terminal subway station with the classic station name &quot;GRAND CENTRAL&quot; spelled out in elegant white ceramic mosaic tile letters embedded in a dark green tile wall, each letter approximately eight inches tall, ornate tile border frames, the S-curve of train tracks visible\u003C\u002Fsub>\n    \u003C\u002Ftd>\n    \u003Ctd width=\"33%\" valign=\"top\">\n      \u003Cimg src=\"assets\u002Fgallery\u002F011-1664x1248.png\" alt=\"Lens gallery sample 011\" width=\"100%\" \u002F>\n      \u003Cbr \u002F>\n      \u003Csub>\u003Cb>Sample 011\u003C\u002Fb> &middot; 1664x1248\u003Cbr \u002F>A ruby-throated hummingbird hovering in front of a bright red heliconia flower, wings frozen in a figure-eight pattern showing iridescent feather detail, individual water droplets suspended around the bird, high-speed macro photography with dark background\u003C\u002Fsub>\n    \u003C\u002Ftd>\n  \u003C\u002Ftr>\n\u003C\u002Ftable>\n\u003C\u002Fdetails>\n\n\u003Cdetails name=\"lens-gallery\">\n  \u003Csummary>\u003Cb>Page 3 \u002F 6\u003C\u002Fb> &nbsp; samples 012-017\u003C\u002Fsummary>\n\n\u003Ctable>\n  \u003Ctr>\n    \u003Ctd width=\"33%\" valign=\"top\">\n      \u003Cimg src=\"assets\u002Fgallery\u002F012-1664x1248.png\" alt=\"Lens gallery sample 012\" width=\"100%\" \u002F>\n      \u003Cbr \u002F>\n      \u003Csub>\u003Cb>Sample 012\u003C\u002Fb> &middot; 1664x1248\u003Cbr \u002F>An old Remington typewriter with a sheet of cream-colored paper rolled into the carriage, the typed words &quot;Chapter One: The Beginning&quot; visible in slightly uneven Courier typeface with characteristic ink density variations, some letters slightly misaligned, warm desk lamp lighting\u003C\u002Fsub>\n    \u003C\u002Ftd>\n    \u003Ctd width=\"33%\" valign=\"top\">\n      \u003Cimg src=\"assets\u002Fgallery\u002F013-1664x1248.png\" alt=\"Lens gallery sample 013\" width=\"100%\" \u002F>\n      \u003Cbr \u002F>\n      \u003Csub>\u003Cb>Sample 013\u003C\u002Fb> &middot; 1664x1248\u003Cbr \u002F>The Great Wildebeest Migration crossing the Mara River at golden hour, hundreds of animals plunging into churning water sending spray everywhere, dust clouds rising from the riverbank, dramatic backlit scene, National Geographic documentary style\u003C\u002Fsub>\n    \u003C\u002Ftd>\n    \u003Ctd width=\"33%\" valign=\"top\">\n      \u003Cimg src=\"assets\u002Fgallery\u002F014-1248x1664.png\" alt=\"Lens gallery sample 014\" width=\"100%\" \u002F>\n      \u003Cbr \u002F>\n      \u003Csub>\u003Cb>Sample 014\u003C\u002Fb> &middot; 1248x1664\u003Cbr \u002F>A charming flower shop storefront window with hand-painted white script lettering on the glass reading &quot;Fresh Flowers Daily&quot; in flowing connected cursive with decorative swashes, roses and peonies arranged in buckets visible through the lettering, morning sunlight catching the painted letters\u003C\u002Fsub>\n    \u003C\u002Ftd>\n  \u003C\u002Ftr>\n  \u003Ctr>\n    \u003Ctd width=\"33%\" valign=\"top\">\n      \u003Cimg src=\"assets\u002Fgallery\u002F015-1248x1664.png\" alt=\"Lens gallery sample 015\" width=\"100%\" \u002F>\n      \u003Cbr \u002F>\n      \u003Csub>\u003Cb>Sample 015\u003C\u002Fb> &middot; 1248x1664\u003Cbr \u002F>A steampunk floating sky-city built on massive gear-driven platforms, brass and copper towers connected by chain bridges, steam-powered airships and hot air balloons docking at various levels, sunset clouds below the city, detailed concept art\u003C\u002Fsub>\n    \u003C\u002Ftd>\n    \u003Ctd width=\"33%\" valign=\"top\">\n      \u003Cimg src=\"assets\u002Fgallery\u002F016-1664x1248.png\" alt=\"Lens gallery sample 016\" width=\"100%\" \u002F>\n      \u003Cbr \u002F>\n      \u003Csub>\u003Cb>Sample 016\u003C\u002Fb> &middot; 1664x1248\u003Cbr \u002F>Milford Sound in New Zealand at dawn, a perfect mirror reflection of steep fjord walls on glass-still water, waterfalls streaming down thousand-foot cliffs, morning mist hovering above the water surface, panoramic landscape photography\u003C\u002Fsub>\n    \u003C\u002Ftd>\n    \u003Ctd width=\"33%\" valign=\"top\">\n      \u003Cimg src=\"assets\u002Fgallery\u002F017-1248x1664.png\" alt=\"Lens gallery sample 017\" width=\"100%\" \u002F>\n      \u003Cbr \u002F>\n      \u003Csub>\u003Cb>Sample 017\u003C\u002Fb> &middot; 1248x1664\u003Cbr \u002F>An Indian Bharatanatyam classical dancer in the aramandi pose, bronze ankle bells and elaborate hand mudra gestures, rich silk costume with gold temple jewelry, captured mid-performance with dramatic stage lighting\u003C\u002Fsub>\n    \u003C\u002Ftd>\n  \u003C\u002Ftr>\n\u003C\u002Ftable>\n\u003C\u002Fdetails>\n\n\u003Cdetails name=\"lens-gallery\">\n  \u003Csummary>\u003Cb>Page 4 \u002F 6\u003C\u002Fb> &nbsp; samples 018-023\u003C\u002Fsummary>\n\n\u003Ctable>\n  \u003Ctr>\n    \u003Ctd width=\"33%\" valign=\"top\">\n      \u003Cimg src=\"assets\u002Fgallery\u002F018-1248x1664.png\" alt=\"Lens gallery sample 018\" width=\"100%\" \u002F>\n      \u003Cbr \u002F>\n      \u003Csub>\u003Cb>Sample 018\u003C\u002Fb> &middot; 1248x1664\u003Cbr \u002F>A narrow alleyway in Marrakech&#x27;s old medina with walls painted in vivid cobalt blue, colorful handwoven rugs and ceramic plates displayed along the walls, ornate wooden doors, warm sunlight from above creating dramatic shadows, Moroccan architecture\u003C\u002Fsub>\n    \u003C\u002Ftd>\n    \u003Ctd width=\"33%\" valign=\"top\">\n      \u003Cimg src=\"assets\u002Fgallery\u002F019-1664x1248.png\" alt=\"Lens gallery sample 019\" width=\"100%\" \u002F>\n      \u003Cbr \u002F>\n      \u003Csub>\u003Cb>Sample 019\u003C\u002Fb> &middot; 1664x1248\u003Cbr \u002F>A rustic wooden sign at a fishing village dock reading &quot;Fresh Catch of the Day&quot; in hand-carved letters painted nautical blue, thick hemp rope threaded through the sign as a border, fishing nets and lobster traps stacked in the background, seaside atmosphere\u003C\u002Fsub>\n    \u003C\u002Ftd>\n    \u003Ctd width=\"33%\" valign=\"top\">\n      \u003Cimg src=\"assets\u002Fgallery\u002F020-1664x1248.png\" alt=\"Lens gallery sample 020\" width=\"100%\" \u002F>\n      \u003Cbr \u002F>\n      \u003Csub>\u003Cb>Sample 020\u003C\u002Fb> &middot; 1664x1248\u003Cbr \u002F>A sunken shipwreck on the ocean floor completely overgrown with colorful coral formations, schools of tropical fish swimming through the broken hull and portholes, shafts of sunlight streaming down from the surface above, underwater archaeology photography\u003C\u002Fsub>\n    \u003C\u002Ftd>\n  \u003C\u002Ftr>\n  \u003Ctr>\n    \u003Ctd width=\"33%\" valign=\"top\">\n      \u003Cimg src=\"assets\u002Fgallery\u002F021-1664x1248.png\" alt=\"Lens gallery sample 021\" width=\"100%\" \u002F>\n      \u003Cbr \u002F>\n      \u003Csub>\u003Cb>Sample 021\u003C\u002Fb> &middot; 1664x1248\u003Cbr \u002F>Zhangjiajie pillar mountains rising above a sea of clouds at sunrise, golden light painting the sandstone peaks, the surreal Avatar-like floating mountain landscape stretching to the horizon, aerial drone photography capturing immense vertical scale\u003C\u002Fsub>\n    \u003C\u002Ftd>\n    \u003Ctd width=\"33%\" valign=\"top\">\n      \u003Cimg src=\"assets\u002Fgallery\u002F022-1440x1440.png\" alt=\"Lens gallery sample 022\" width=\"100%\" \u002F>\n      \u003Cbr \u002F>\n      \u003Csub>\u003Cb>Sample 022\u003C\u002Fb> &middot; 1440x1440\u003Cbr \u002F>A red-eyed tree frog perched on a bright red bromeliad flower in the Costa Rican cloud forest, its neon green body contrasting with blue-striped flanks and orange feet, water droplets on its smooth skin, extreme macro with ring flash lighting\u003C\u002Fsub>\n    \u003C\u002Ftd>\n    \u003Ctd width=\"33%\" valign=\"top\">\n      \u003Cimg src=\"assets\u002Fgallery\u002F023-1248x1664.png\" alt=\"Lens gallery sample 023\" width=\"100%\" \u002F>\n      \u003Cbr \u002F>\n      \u003Csub>\u003Cb>Sample 023\u003C\u002Fb> &middot; 1248x1664\u003Cbr \u002F>Inside a massive limestone cave, ancient stalactites and stalagmites meeting to form columns, an underground river reflecting the formations like a mirror, subtle warm lighting revealing millions of years of mineral deposits, spelunking exploration photography\u003C\u002Fsub>\n    \u003C\u002Ftd>\n  \u003C\u002Ftr>\n\u003C\u002Ftable>\n\u003C\u002Fdetails>\n\n\u003Cdetails name=\"lens-gallery\">\n  \u003Csummary>\u003Cb>Page 5 \u002F 6\u003C\u002Fb> &nbsp; samples 024-029\u003C\u002Fsummary>\n\n\u003Ctable>\n  \u003Ctr>\n    \u003Ctd width=\"33%\" valign=\"top\">\n      \u003Cimg src=\"assets\u002Fgallery\u002F024-1664x1248.png\" alt=\"Lens gallery sample 024\" width=\"100%\" \u002F>\n      \u003Cbr \u002F>\n      \u003Csub>\u003Cb>Sample 024\u003C\u002Fb> &middot; 1664x1248\u003Cbr \u002F>A weathered 1960s gas station with a large roadside sign reading &quot;ROUTE 66 GAS &amp; GO&quot; in retro rounded sans-serif letters with a red and white color scheme, vintage gas pumps with analog dials in the foreground, a classic Chevrolet parked to the side, Americana nostalgia\u003C\u002Fsub>\n    \u003C\u002Ftd>\n    \u003Ctd width=\"33%\" valign=\"top\">\n      \u003Cimg src=\"assets\u002Fgallery\u002F025-1664x1248.png\" alt=\"Lens gallery sample 025\" width=\"100%\" \u002F>\n      \u003Cbr \u002F>\n      \u003Csub>\u003Cb>Sample 025\u003C\u002Fb> &middot; 1664x1248\u003Cbr \u002F>Construction site hoarding covered in unauthorized street art with &quot;ART IS EVERYWHERE&quot; spray-painted in large freehand capital letters using multiple overlapping colors of red, yellow and blue, paint drips running down from each letter, chaotic beautiful urban canvas\u003C\u002Fsub>\n    \u003C\u002Ftd>\n    \u003Ctd width=\"33%\" valign=\"top\">\n      \u003Cimg src=\"assets\u002Fgallery\u002F026-1664x1248.png\" alt=\"Lens gallery sample 026\" width=\"100%\" \u002F>\n      \u003Cbr \u002F>\n      \u003Csub>\u003Cb>Sample 026\u003C\u002Fb> &middot; 1664x1248\u003Cbr \u002F>Top-down view of a koi pond, dozens of ornamental koi fish in vivid red white orange and gold patterns swimming through crystal-clear emerald water, fallen cherry blossom petals floating on the surface, Japanese garden aerial photography\u003C\u002Fsub>\n    \u003C\u002Ftd>\n  \u003C\u002Ftr>\n  \u003Ctr>\n    \u003Ctd width=\"33%\" valign=\"top\">\n      \u003Cimg src=\"assets\u002Fgallery\u002F027-1664x1248.png\" alt=\"Lens gallery sample 027\" width=\"100%\" \u002F>\n      \u003Cbr \u002F>\n      \u003Csub>\u003Cb>Sample 027\u003C\u002Fb> &middot; 1664x1248\u003Cbr \u002F>The Potala Palace in Lhasa under a canopy of stars with the Milky Way arching overhead, Tibetan prayer wheels and butter lamps in the foreground casting warm golden light, the massive white and red palace walls glowing in moonlight, night photography\u003C\u002Fsub>\n    \u003C\u002Ftd>\n    \u003Ctd width=\"33%\" valign=\"top\">\n      \u003Cimg src=\"assets\u002Fgallery\u002F028-1248x1664.png\" alt=\"Lens gallery sample 028\" width=\"100%\" \u002F>\n      \u003Cbr \u002F>\n      \u003Csub>\u003Cb>Sample 028\u003C\u002Fb> &middot; 1248x1664\u003Cbr \u002F>Yellowstone&#x27;s Grand Prismatic Spring shot from directly above by drone, concentric rings of vivid blue turquoise green yellow and orange created by thermophilic bacteria, steam rising from the surface, abstract natural color palette\u003C\u002Fsub>\n    \u003C\u002Ftd>\n    \u003Ctd width=\"33%\" valign=\"top\">\n      \u003Cimg src=\"assets\u002Fgallery\u002F029-1664x1248.png\" alt=\"Lens gallery sample 029\" width=\"100%\" \u002F>\n      \u003Cbr \u002F>\n      \u003Csub>\u003Cb>Sample 029\u003C\u002Fb> &middot; 1664x1248\u003Cbr \u002F>A herd of African elephants walking in a line across the savanna with Mount Kilimanjaro&#x27;s snow-capped peak behind them, golden sunset dust kicked up by their feet creating a hazy atmosphere, telephoto wildlife photography showing massive scale\u003C\u002Fsub>\n    \u003C\u002Ftd>\n  \u003C\u002Ftr>\n\u003C\u002Ftable>\n\u003C\u002Fdetails>\n\n\u003Cdetails name=\"lens-gallery\">\n  \u003Csummary>\u003Cb>Page 6 \u002F 6\u003C\u002Fb> &nbsp; samples 030-031\u003C\u002Fsummary>\n\n\u003Ctable>\n  \u003Ctr>\n    \u003Ctd width=\"33%\" valign=\"top\">\n      \u003Cimg src=\"assets\u002Fgallery\u002F030-1664x1248.png\" alt=\"Lens gallery sample 030\" width=\"100%\" \u002F>\n      \u003Cbr \u002F>\n      \u003Csub>\u003Cb>Sample 030\u003C\u002Fb> &middot; 1664x1248\u003Cbr \u002F>The Hall of Mirrors at the Palace of Versailles, hundreds of candles reflected infinitely in the massive gilded mirrors, crystal chandeliers casting prismatic light across painted ceilings and gold leaf ornamentation, Baroque opulence\u003C\u002Fsub>\n    \u003C\u002Ftd>\n    \u003Ctd width=\"33%\" valign=\"top\">\n      \u003Cimg src=\"assets\u002Fgallery\u002F031-1664x1248.png\" alt=\"Lens gallery sample 031\" width=\"100%\" \u002F>\n      \u003Cbr \u002F>\n      \u003Csub>\u003Cb>Sample 031\u003C\u002Fb> &middot; 1664x1248\u003Cbr \u002F>A pirate captain&#x27;s cabin, navigation charts pinned to the wall, a brass telescope and astrolabe on the desk, stacks of gold coins and a jewel-encrusted goblet, rum bottle, warm swinging lantern light casting shadows with the ship&#x27;s motion\u003C\u002Fsub>\n    \u003C\u002Ftd>\n    \u003Ctd width=\"33%\">\u003C\u002Ftd>\n  \u003C\u002Ftr>\n  \u003Ctr>\n    \u003Ctd width=\"33%\">\u003C\u002Ftd>\n    \u003Ctd width=\"33%\">\u003C\u002Ftd>\n    \u003Ctd width=\"33%\">\u003C\u002Ftd>\n  \u003C\u002Ftr>\n\u003C\u002Ftable>\n\u003C\u002Fdetails>\n\u003C!-- LENS_GALLERY_END -->\n\n## Installation\n\n> **Tested environment:** Python 3.12 &middot; CUDA 12.6 &middot; PyTorch 2.11.0+cu126 &middot; TorchVision 0.26.0+cu126\n\n```bash\nconda create -n lens python=3.12 -y\nconda activate lens\n\nuv pip install torch==2.11.0+cu126 torchvision==0.26.0+cu126 \\\n    --index-url https:\u002F\u002Fdownload.pytorch.org\u002Fwhl\u002Fcu126\nuv pip install -r requirements.txt\n```\n\nThe default GPT-OSS encoder and FLUX.2 VAE are loaded from Hugging Face. Make sure your environment has access to any gated model repositories you use.\n\n## Checkpoints\n\n| Repo | Description | Steps | CFG |\n| :--- | :--- | :---: | :---: |\n| [`microsoft\u002FLens`](https:\u002F\u002Fhuggingface.co\u002Fmicrosoft\u002FLens) | **Default.** RL-tuned for visual quality | 20 | 5.0 |\n| [`microsoft\u002FLens-Turbo`](https:\u002F\u002Fhuggingface.co\u002Fmicrosoft\u002FLens-Turbo) | Distilled from the RL model for fast 4-step sampling | 4 | 1.0 |\n| [`microsoft\u002FLens-Base`](https:\u002F\u002Fhuggingface.co\u002Fmicrosoft\u002FLens-Base) | Supervised base model (no RL, no distillation) | 50 | 5.0 |\n\nPick a variant by passing its repo id to `--repo_id` (CLI) or `LensPipeline.from_pretrained(...)` (Python).\n\n## Inference\n\n> **Important:** run from the cloned repo root so `from lens import LensPipeline` resolves to this package &mdash; importing `lens` is what registers `LensGptOssEncoder` \u002F `LensTransformer2DModel` with the `transformers` and `diffusers` namespaces that `model_index.json` references.\n\n**Python API:**\n\n```python\nimport torch\nfrom lens import LensPipeline\n\npipe = LensPipeline.from_pretrained(\n    \"microsoft\u002FLens\", torch_dtype=torch.bfloat16\n).to(\"cuda\")\n\nimage = pipe(\n    prompt=\"A cat holding a sign that says \\\"hello world\\\"\",\n    base_resolution=1440, aspect_ratio=\"1:1\",\n    num_inference_steps=20, guidance_scale=5.0,\n    generator=torch.Generator(\"cuda\").manual_seed(0),\n).images[0]\nimage.save(\"lens.png\")\n```\n\nTo trade speed for VRAM, replace `.to(\"cuda\")` with `pipe.enable_model_cpu_offload()`.\n\n**CLI &mdash; basic usage:**\n\n```bash\npython inference.py \\\n    --repo_id \"microsoft\u002FLens\" \\\n    --prompt \"A cinematic mountain lake at sunrise, soft mist, detailed reflections\" \\\n    --base_resolution 1440 --aspect_ratio 1:1 \\\n    --steps 20 --cfg 5.0 --n 1 --seed 42 \\\n    --out .\u002Foutputs\n```\n\n**Batch generation** &mdash; join multiple prompts with `|`:\n\n```bash\npython inference.py \\\n    --repo_id \"microsoft\u002FLens\" \\\n    --steps 20 --cfg 5.0 \\\n    --prompt \"a red fox in snow|a glass greenhouse at night\"\n```\n\n**A100 \u002F V100 (no MXFP4 kernels)** &mdash; dequantize the GPT-OSS encoder to bf16:\n\n```bash\npython inference.py \\\n    --repo_id \"microsoft\u002FLens\" \\\n    --steps 20 --cfg 5.0 \\\n    --prompt \"a cat\" \\\n    --disable_mxfp4 --offload\n```\n\n### Options\n\n| Flag | Description | Default |\n| :--- | :--- | :--- |\n| `--repo_id` | HF repo id (or local path) of the assembled Lens pipeline | `microsoft\u002FLens` |\n| `--base_resolution` | `1024` or `1440` | `1440` |\n| `--aspect_ratio` | `1:2`, `9:16`, `2:3`, `3:4`, `1:1`, `4:3`, `3:2`, `16:9`, `2:1` | `1:1` |\n| `--steps` | Number of denoising steps | `20` |\n| `--cfg` | Classifier-free guidance scale | `5.0` |\n| `--n` | Number of images per prompt | `1` |\n| `--seed` | Random seed (omit for non-deterministic) | &mdash; |\n| `--out` | Output directory | `.\u002Foutputs` |\n| `--dtype` | Compute dtype: `bfloat16`, `float16`, `float32` | `bfloat16` |\n| `--disable_mxfp4` | Dequantize the GPT-OSS text encoder to `--dtype` (required on A100 \u002F V100; Hopper+ keeps MXFP4 by default for less VRAM) | &mdash; |\n| `--offload` | Enable diffusers CPU offload (`text_encoder->transformer->vae`) to reduce peak VRAM | &mdash; |\n| `--reasoner` | Refine prompts with the loaded GPT-OSS encoder before generation | &mdash; |\n| `--api_url` \u002F `--api_key` \u002F `--api_model` | Use an OpenAI-compatible API for prompt refinement (takes precedence over `--reasoner`) | &mdash; |\n\n## Citation\n\n```bibtex\n@article{zhao2026lens,\n  title   = {Lens: Rethinking Training Efficiency for Foundational Text-to-Image Models},\n  author  = {Guo, Baining and Luo, Chong and Chen, Dong and Chen, Dongdong and Wei, Fangyun and Li, Ji and Bao, Jianmin and Zhang, Jiawei and Zhao, Jinjing and Shi, Lei and Yang, Qinhong and Zhang, Sirui and Wu, Xiuyu and Feng, Xuelu and Lu, Yan and Dong, Yanchen and Yue, Yang and Wang, Yitong and Chen, Yunuo and Liang, Zhiyang and Wan, Ziyu},\n  journal = {arXiv preprint arXiv:2605.21573},\n  year    = {2026}\n}\n```\n\n## Responsible AI\n\nThe model is released for research purposes only and is not intended for product or service deployment. Responsible AI considerations were incorporated throughout the development process, including data selection, model training, and evaluation.\nThe training data includes a combination of public, licensed, and internal datasets that were processed to remove clearly identifiable personal information and reduce harmful content where possible. However, as the data is largely sourced from web-scale collections, it may contain biases or uneven representation. As a result, the model may generate outputs that are inaccurate, biased, or inappropriate under certain prompts, including content that could be misleading or raise copyright or IP-related concerns.\nGiven these limitations, the model should be used in controlled research settings, with appropriate human oversight. Downstream users are responsible for applying additional safeguards, such as content moderation, validation, and compliance checks, before using the model in broader applications.\n\n## Privacy\n\nThis project does not collect any usage data. For more information, see the [Microsoft Privacy Statement](https:\u002F\u002Fgo.microsoft.com\u002Ffwlink\u002F?LinkId=521839).\n\n## License\n\nThis project is released under the [MIT License](LICENSE).\n","Lens 是一个拥有38亿参数的文本到图像生成模型，旨在以更少的训练计算资源实现与FLUX和SD3等模型相媲美甚至超越的质量。其核心功能包括通过密集字幕预训练、混合分辨率学习、GPT-OSS多层文本特征以及FLUX.2语义VAE来提高训练效率并加速收敛。该模型特别适合需要高效训练且追求高质量图像生成的应用场景，如创意设计、广告制作或个人艺术创作等领域。此外，Lens还支持灵活的分辨率设置（最高可达1440x1440），并通过强化学习调整进一步提升了视觉质量和细节表现力。",2,"2026-06-11 03:56:41","CREATED_QUERY"]