Add LumaGuide text-to-histogram regressor, test prompts, and model card
Browse files- README.md +73 -0
- regressor.pt +3 -0
- test_prompts.csv +101 -0
README.md
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: mit
|
| 3 |
+
pipeline_tag: text-to-image
|
| 4 |
+
library_name: pytorch
|
| 5 |
+
tags:
|
| 6 |
+
- hdr
|
| 7 |
+
- hdr-generation
|
| 8 |
+
- diffusion
|
| 9 |
+
- guidance
|
| 10 |
+
- training-free
|
| 11 |
+
- flux
|
| 12 |
+
- distribution-shaping
|
| 13 |
+
- luminance
|
| 14 |
+
base_model:
|
| 15 |
+
- black-forest-labs/FLUX.1-dev
|
| 16 |
+
base_model_relation: adapter
|
| 17 |
+
---
|
| 18 |
+
|
| 19 |
+
# LumaGuide: text-to-histogram regressor and test prompts
|
| 20 |
+
|
| 21 |
+
Assets for **LumaGuide: Distribution Shaping for Training-Free HDR Generation in Diffusion Models** (Bowen Chen, Shreshth Saini, Balu Adsumilli, Alan C. Bovik).
|
| 22 |
+
|
| 23 |
+
- Paper: https://arxiv.org/abs/2607.26237
|
| 24 |
+
- Code: https://github.com/shreshthsaini/LumaGuide
|
| 25 |
+
- Project page: https://shreshthsaini.github.io/LumaGuide/
|
| 26 |
+
|
| 27 |
+
LumaGuide is training-free. It steers a pretrained diffusion model at sampling time so that a feature distribution of the output matches a target, using differentiable energy-based guidance. For HDR generation the feature is the PQ-space luminance histogram, matched with a Wasserstein-1 loss back-propagated through the VAE decoder of Flux.1-dev. The diffusion transformer is never trained or modified.
|
| 28 |
+
|
| 29 |
+
## What is in this repo
|
| 30 |
+
|
| 31 |
+
| File | Purpose |
|
| 32 |
+
| --- | --- |
|
| 33 |
+
| `regressor.pt` | Caption-to-histogram regressor: a 3-layer MLP (768 to 256 to 256 to 32, GELU) on the pooled `openai/clip-vit-large-patch14` text embedding, softmax output over 32 PQ-luminance bins. 270,880 parameters, 1.1 MB. This is the default target source for `--target regressor`. |
|
| 34 |
+
| `test_prompts.csv` | The 100 HDR test prompts used in the paper, with generation width and height. |
|
| 35 |
+
|
| 36 |
+
The regressor only provides the target histogram. The guidance itself, the PQ luminance utilities, and the Flux sampler hooks live in the GitHub repo.
|
| 37 |
+
|
| 38 |
+
## Usage
|
| 39 |
+
|
| 40 |
+
```bash
|
| 41 |
+
git clone https://github.com/shreshthsaini/LumaGuide && cd LumaGuide
|
| 42 |
+
pip install -r requirements.txt
|
| 43 |
+
huggingface-cli download shreshthsaini/LumaGuide regressor.pt --local-dir .
|
| 44 |
+
python lumaguide.py --prompt "A skier at the top of a glacier as the sun rises" \
|
| 45 |
+
--target regressor --regressor_ckpt regressor.pt --out out.hdr
|
| 46 |
+
```
|
| 47 |
+
|
| 48 |
+
Or load the checkpoint yourself:
|
| 49 |
+
|
| 50 |
+
```python
|
| 51 |
+
import torch
|
| 52 |
+
from huggingface_hub import hf_hub_download
|
| 53 |
+
state = torch.load(hf_hub_download("shreshthsaini/LumaGuide", "regressor.pt"), map_location="cpu", weights_only=False)
|
| 54 |
+
state["config"] # {'in_dim': 768, 'hidden': 256, 'n_bins': 32}
|
| 55 |
+
state["model_state"] # weights for HistRegressor in lumaguide.py
|
| 56 |
+
```
|
| 57 |
+
|
| 58 |
+
Flux.1-dev is downloaded separately from Hugging Face and is gated; accept its license first. It needs about 30 GB of VRAM at 512x512 with LumaGuide's VAE backward pass.
|
| 59 |
+
|
| 60 |
+
## License
|
| 61 |
+
|
| 62 |
+
The regressor and prompts are released under MIT. Flux.1-dev is governed by the Black Forest Labs non-commercial license.
|
| 63 |
+
|
| 64 |
+
## Citation
|
| 65 |
+
|
| 66 |
+
```bibtex
|
| 67 |
+
@article{chen2026lumaguide,
|
| 68 |
+
title = {LumaGuide: Distribution Shaping for Training-Free HDR Generation in Diffusion Models},
|
| 69 |
+
author = {Chen, Bowen and Saini, Shreshth and Adsumilli, Balu and Bovik, Alan C.},
|
| 70 |
+
journal = {arXiv preprint arXiv:2607.26237},
|
| 71 |
+
year = {2026}
|
| 72 |
+
}
|
| 73 |
+
```
|
regressor.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f51ba77bf5a702e461ee21ba650b79ebb4d5c30a2ee0e3056329a757038d05e8
|
| 3 |
+
size 1086829
|
test_prompts.csv
ADDED
|
@@ -0,0 +1,101 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
prompt,width,height
|
| 2 |
+
"A skier prepares at the top of a glacier as the sun rises, ice glittering with morning light.",512,512
|
| 3 |
+
"A medieval castle catches the first sunrise on its highest tower, the courtyard still in deep shadow.",512,512
|
| 4 |
+
"A heron stands in marsh water at golden hour, plumage backlit and translucent against bright water.",512,512
|
| 5 |
+
"Dusk above clouds from an airplane window, tops of clouds glowing pink against a deep blue stratosphere.",512,512
|
| 6 |
+
"A camel caravan crosses sand dunes at sunset, riders silhouetted against blazing sky.",512,512
|
| 7 |
+
"A monastery on a cliff at sunset, prayer flags fluttering in golden light against deep mountain shadow.",512,512
|
| 8 |
+
"A horseman gallops along a coastline at golden hour, spray and dust catching the low sun.",512,512
|
| 9 |
+
"A full moon rises over a calm sea, casting a brilliant silver path across the water.",512,512
|
| 10 |
+
"A lighthouse at midnight, brilliant sweeping beam cuts through fog and rain.",512,512
|
| 11 |
+
"A cruise ship lit up at sea at night, every porthole and deck blazing against pitch black ocean.",512,512
|
| 12 |
+
"An astronomer at a dark-sky preserve, red headlamp barely illuminating telescope under starlight.",512,512
|
| 13 |
+
"A Japanese pagoda illuminated at night, surrounding garden in deep shadow.",512,512
|
| 14 |
+
"A coal-burning kiln at night, brilliant orange flame visible through the kiln door, smoke against black sky.",512,512
|
| 15 |
+
"A surgical theater with overhead operating lights blazing white, surrounding room in shadow.",512,512
|
| 16 |
+
"A dim bar with neon signs in the windows, single bartender backlit against mirrored shelf.",512,512
|
| 17 |
+
A gallery of medieval armor lit by single spotlights against black walls.,512,512
|
| 18 |
+
A church confessional booth with light streaming through a thin lattice screen.,512,512
|
| 19 |
+
"A school gymnasium with overhead lights blazing onto wooden floor, basketball court empty.",512,512
|
| 20 |
+
"A foundry pour, molten metal glowing intensely white-orange spilling into a casting mold.",512,512
|
| 21 |
+
"A coal-fired power plant at night, smokestacks lit by warning lights against black smoke.",512,512
|
| 22 |
+
"A laser cutter at work in a workshop, brilliant red beam cutting through metal sheet.",512,512
|
| 23 |
+
"A precision machining shop, single overhead lamp directly illuminating a lathe.",512,512
|
| 24 |
+
"A fireworks finale over a harbor, bursts illuminating water and waterfront buildings.",512,512
|
| 25 |
+
"A formula one car at night under track floodlights, brake discs glowing red-hot.",512,512
|
| 26 |
+
"A cherry blossom street at evening, lanterns lighting petals against dusk sky.",512,512
|
| 27 |
+
A 24-hour donut shop window glowing warmly on an empty late-night street.,512,512
|
| 28 |
+
"An outdoor cafe at twilight, candles on each table glowing under string lights overhead.",512,512
|
| 29 |
+
"A medieval cobbled street with hanging lanterns at dusk, warm pools of light at intervals.",512,512
|
| 30 |
+
"A frozen lake at noon, sun reflected in dazzling pinpricks across the ice surface.",512,512
|
| 31 |
+
"A car showroom with high-end vehicles, polished bodies reflecting overhead bright lights.",512,512
|
| 32 |
+
"Frost crystals on a window pane backlit by morning sun, intense sparkling pattern.",512,512
|
| 33 |
+
"A wet seal on a rock catching sunset, water on fur creating brilliant highlights.",512,512
|
| 34 |
+
A water cyclone reaching down to a calm ocean surface in afternoon light.,512,512
|
| 35 |
+
"A glory phenomenon seen from an airplane over clouds, plane shadow surrounded by rainbow rings.",512,512
|
| 36 |
+
"Volcanic lightning over an erupting volcano cone at night, ash plume illuminated.",512,512
|
| 37 |
+
"Ground blizzard at night, headlights revealing dense streaming snowflakes.",512,512
|
| 38 |
+
"A snow-blind tundra at midday, all features bleached out except thin tracks.",512,512
|
| 39 |
+
A school of silver fish flash and glint near the surface of a sunlit reef.,512,512
|
| 40 |
+
A railway station platform with sun streaming through a vaulted iron-and-glass roof.,512,512
|
| 41 |
+
"A planetarium dome from inside during a Saturn close-up, planet glowing on the dome.",512,512
|
| 42 |
+
A puppet theater scene with backlit silhouettes performing on a small bright screen.,512,512
|
| 43 |
+
"A laundromat at midnight, dryers tumbling under harsh fluorescent overhead lights.",512,512
|
| 44 |
+
"A street fortune teller's table at twilight, candles between a crystal ball and tarot cards.",512,512
|
| 45 |
+
A lone phone booth illuminated on a dark country road late at night.,512,512
|
| 46 |
+
An underwater scuba diver's helmet lamp illuminating a small circle of coral reef.,512,512
|
| 47 |
+
"Snow-covered fir forest at sunset, low sun cutting horizontally between trunks.",512,512
|
| 48 |
+
"A bamboo forest at midday, vertical sunbeams cutting downward between green stalks.",512,512
|
| 49 |
+
A mountain cirque at dawn with first light glancing onto snowfields above shadow valleys.,512,512
|
| 50 |
+
"Polar bears on a melting ice floe at midnight sun, golden Arctic light on white fur.",512,512
|
| 51 |
+
"An olive grove on a Mediterranean hillside at noon, dappled shade through silver-green leaves.",512,512
|
| 52 |
+
"A cactus garden in the desert at noon, spines casting tiny shadows on succulent surfaces.",512,512
|
| 53 |
+
"An autumn forest glade at golden hour, fallen yellow leaves catching low sun.",512,512
|
| 54 |
+
"A herd of elephants drinking at a waterhole at golden hour, dust catching low sun.",512,512
|
| 55 |
+
"A snow leopard on a snowy ridge at dusk, fur catching the last warm light.",512,512
|
| 56 |
+
"An eagle's nest on a cliff, parent landing with a fish caught in golden light.",512,512
|
| 57 |
+
A chemical reactor lab with neon glow tubes monitoring reactions in dim room.,512,512
|
| 58 |
+
"A weightlifter at the moment of overhead lift, intense stage lighting on barbell.",512,512
|
| 59 |
+
"An archer at a competition with overhead spots, bowstring tension visible.",512,512
|
| 60 |
+
A boxing knockout punch frozen in mid-impact under arena floodlights.,512,512
|
| 61 |
+
A dressage horse and rider perform under early evening floodlights.,512,512
|
| 62 |
+
Indian temple at twilight with thousands of oil lamps lining stone steps.,512,512
|
| 63 |
+
"A Mexican Day of the Dead altar by candlelight, ofrendas casting flickering shadows.",512,512
|
| 64 |
+
"An Easter sunrise service on a hillside, dawn light over a small congregation.",512,512
|
| 65 |
+
A Burning Man art piece illuminated at dawn against the desert plain.,512,512
|
| 66 |
+
"A Mardi Gras balcony scene at night, beads catching streetlamp light below.",512,512
|
| 67 |
+
London's Tower Bridge at twilight with lights coming on against a deep blue sky.,512,512
|
| 68 |
+
"Hong Kong skyline at night with full neon, junks crossing harbor with strung lights.",512,512
|
| 69 |
+
"Singapore's Gardens by the Bay supertree grove at twilight, illuminated in color.",512,512
|
| 70 |
+
"Rio's Christ the Redeemer at sunrise, statue silhouetted against dawn sky.",512,512
|
| 71 |
+
"Kyoto bamboo forest at dawn, low light filtering through high green stalks.",512,512
|
| 72 |
+
"Iceland's Skogafoss waterfall at midnight sun, falling water glowing.",512,512
|
| 73 |
+
"New Zealand's Milford Sound at dawn, mist rising from black water under cliffs.",512,512
|
| 74 |
+
"China's Great Wall at sunrise, fortifications snaking over hills into golden light.",512,512
|
| 75 |
+
"Spain's La Sagrada Familia at golden hour, intricate stonework throwing complex shadows.",512,512
|
| 76 |
+
"Germany's Neuschwanstein castle at dawn, towers rising above forest mist.",512,512
|
| 77 |
+
Crystal cave with naturally lit selenite formations from above through a sinkhole.,512,512
|
| 78 |
+
A twilight thunderstorm cell with frequent lightning above a desert mesa.,512,512
|
| 79 |
+
A potter's hands shaping a wet clay vessel under workshop task lighting.,512,512
|
| 80 |
+
An old fisherman's hands mending nets in afternoon light on a dock.,512,512
|
| 81 |
+
A samurai's hands gripping a katana in the moonlit doorway of a dojo.,512,512
|
| 82 |
+
A sommelier's hand pouring red wine into a crystal glass under restaurant chandelier.,512,512
|
| 83 |
+
"A tide pool at low tide on a sunny afternoon, anemones and starfish in clear water.",512,512
|
| 84 |
+
"A vintage map shop with tall windows, sun streaming onto a desk piled with charts.",512,512
|
| 85 |
+
"A cave swimming hole at noon, sunbeam from cave opening lighting clear blue water.",512,512
|
| 86 |
+
"A glass-bottomed boat above a coral reef at midday, fish visible swimming below.",512,512
|
| 87 |
+
"A gondola lift cabin ascending at sunset, passengers silhouetted against alpine vista.",512,512
|
| 88 |
+
"A ferris wheel at twilight with each car lit, reflecting in a still lake.",512,512
|
| 89 |
+
A drive-through redwood tunnel with sunbeams between massive trees.,512,512
|
| 90 |
+
"A military convoy at twilight, headlights raised against backdrop of mountains.",512,512
|
| 91 |
+
A submarine surfacing at dawn with sun glancing off conning tower and sea.,512,512
|
| 92 |
+
A polar research station illuminated at midnight in continuous night.,512,512
|
| 93 |
+
"A space telescope launch at golden hour, rocket body glowing orange.",512,512
|
| 94 |
+
"A foley sound stage with arrayed objects under work lights, microphones overhead.",512,512
|
| 95 |
+
"A model train layout under display lighting, miniature buildings lit from within.",512,512
|
| 96 |
+
"A Mars rover at sunset on the red planet, golden dust in low solar light.",512,512
|
| 97 |
+
A futuristic generation ship corridor at night with bioluminescent floor strips.,512,512
|
| 98 |
+
A subterranean lava tube colony with bright settlement lights inside dark cavern.,512,512
|
| 99 |
+
"A starship arrival in port at twilight, observation deck windows glowing yellow.",512,512
|
| 100 |
+
A robot factory assembly line at night with sparks from welding stations along the conveyor.,512,512
|
| 101 |
+
A Dyson swarm sunrise concept: dense ring of solar collectors silhouetted against star.,512,512
|