Instructions to use Roydon728/GenPolar with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use Roydon728/GenPolar with Diffusers:
pip install -U diffusers transformers accelerate
from diffusers import ControlNetModel, StableDiffusionControlNetPipeline controlnet = ControlNetModel.from_pretrained("Roydon728/GenPolar") pipe = StableDiffusionControlNetPipeline.from_pretrained( "fill-in-base-model", controlnet=controlnet ) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- Draw Things
| library_name: diffusers | |
| pipeline_tag: image-to-image | |
| tags: | |
| - polarization | |
| - image-to-image | |
| - diffusion | |
| - controlnet | |
| - lora | |
| # GenPolar | |
| Official model weights for **GenPolar: Stokes-Informed Diffusion for Robust Linear Polarization Estimation**. | |
| GenPolar estimates the linear Stokes components from an intensity/RGB observation and derives the degree and angle of linear polarization analytically. | |
| ## Released files | |
| | File | Purpose | Required for final inference | | |
| | --- | --- | --- | | |
| | `genpolar_one_step.pth` | Distilled one-step UNet and ControlNet | Yes | | |
| | `genpolar_vae_encoder_lora/` | VAE encoder LoRA adapter used by the one-step model | Yes | | |
| | `genpolar_stage1_teacher.pth` | Stage-one diffusion teacher used for distillation and stage-one reproduction | No | | |
| The `.pth` files are inference-focused exports. They contain only `unet_state_dict` and `controlnet_state_dict`, plus small format metadata. Optimizer states, training counters, the fake score model, training arguments, and duplicate state dictionaries are intentionally excluded. | |
| All released tensors retain their original FP32 values. | |
| ## Base model | |
| The code initializes model components from `runwayml/stable-diffusion-v1-5` before loading the GenPolar state dictionaries. | |
| ## One-step inference | |
| Place the downloaded files under `release_weights/`, then run: | |
| ```bash | |
| python inference.py \ | |
| --ckpt_path ./release_weights/genpolar_one_step.pth \ | |
| --vae_lora_dir ./release_weights/genpolar_vae_encoder_lora \ | |
| --input_folder ./data/DfP \ | |
| --results_folder ./results \ | |
| --fp16 | |
| ``` | |
| The input directory format and full environment setup are documented in the GenPolar source repository. | |
| ## Integrity | |
| SHA-256 hashes are provided in `SHA256SUMS`. | |