Instructions to use lingxiao2049/Rescale with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use lingxiao2049/Rescale with Diffusers:
pip install -U diffusers transformers accelerate
from diffusers import ControlNetModel, StableDiffusionControlNetPipeline controlnet = ControlNetModel.from_pretrained("lingxiao2049/Rescale") pipe = StableDiffusionControlNetPipeline.from_pretrained( "black-forest-labs/FLUX.1-Fill-dev", controlnet=controlnet ) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- Draw Things
Rescale: GenScale scale-correction checkpoint
Released inference components for GenScale: A Benchmark for Relative Object Scale in Image Generation and Editing, by Lingxiao Li, Max Whitton, Ledell Wu, and Boqing Gong.
Code · Project page · Benchmark · Paper
Contents
This is the 499000 checkpoint (the retained checkpoint directory identifier), selected by the public inference wrapper and the research ablation wrapper. It contains about 5.04 GB of inference parameters:
| File | Purpose |
|---|---|
pytorch_lora_weights.safetensors |
BF16 rank-256 LoRA: 686 tensors across 343 modules |
controlnet/config.json |
Depth ControlNet architecture, 4 double blocks and 1 single block |
controlnet/diffusion_pytorch_model.safetensors |
BF16 ControlNet: 170 tensors |
hf_latent_inject.pt |
BF16 high-frequency projection, weight shape 3072×64 |
rescale_adapter_config.json |
Full target-module list and LoRA rank/alpha |
base_lora_config.json |
Pinned upstream Insert-Anything initialization and checksum |
checkpoint_manifest.json |
Provenance, file sizes, and SHA-256 hashes |
VALIDATION.json |
CPU and architecture-validation scope |
The original tensor-file bytes are preserved. Only the nonfunctional local _name_or_path field was removed from the public ControlNet configuration. This repository provides components for the custom GenScale inference code, rather than a complete standalone Diffusers pipeline. Optimizer state and training data are not included.
Download and run
Clone the code repository and follow its dependency instructions, including the separate SAM 2 and Depth Anything V2 setup. From the code repository root:
python -m pip install -r requirements-eval.txt
python scripts/download_rescale.py
The downloader writes weights/499000 and checks the inference files and initialization configuration against the manifest. To download manually:
from huggingface_hub import snapshot_download
snapshot_download("lingxiao2049/Rescale", local_dir="weights/499000")
For reproducible use, supply an immutable model commit SHA with the downloader's --revision option or snapshot_download(..., revision=...).
The full pipeline additionally requires upstream black-forest-labs/FLUX.1-Fill-dev and black-forest-labs/FLUX.1-Redux-dev, SAM 2, Depth Anything V2, adequate GPU memory, and GOOGLE_API_KEY for API-assisted stages. Obtain upstream checkpoints under their own access and license terms.
The retained training launcher initializes the base with WensongSong/Insert-Anything. The updated inference code follows that declared sequence: download the upstream 1.85 GB LoRA at the revision/hash in base_lora_config.json, verify it, fuse it into the Fill transformer, unload its adapter wrappers, then attach the Rescale adapter. The upstream LoRA is fetched from its original public repository and is not mirrored here. Per-run immutable training arguments were not retained, so this initialization follows the retained launcher's declared default. Set INSERTANYTHING_BASE_LORA_PATH to an already downloaded copy of the exact file, or to none only when intentionally using an already merged/custom base.
With those dependencies configured:
IMAGE_PATH=/path/to/input.png \
FEEDBACK_JSON_PATH=/path/to/localized_judge_feedback.json \
bash inference_size_correction.sh
The main Rescale evaluation used localized error feedback. The checkpoint alone is not an autonomous error-discovery system. The code's optional FLUX-Kontext removal backend additionally needs a Diffusers version exposing FluxKontextPipeline; the default Gemini backend uses the pinned environment.
Validation and numerical scope
The release verifies tensor-file hashes, complete safetensors storage, all 686 LoRA names/shapes against the full Flux transformer architecture, all 170 ControlNet names/shapes against its architecture, and the finite 3072×64 high-frequency projection. The pinned upstream initialization has the same 686 adapter tensor names/shapes. CPU tests confirm that actual tensor values load into attention, input, normalization, and feed-forward modules in a small Flux model, that the upstream-style adapter is fused before attaching Rescale, and that missing pairs, incompatible shapes, or wrong initialization hashes fail. The full architecture checks use the meta device and do not allocate or run the complete base model.
During packaging, the older public loader's attention-only configuration and base_model.model. key conversion were corrected. The updated loader loads every saved adapter tensor and fails on mismatches. Historical paper outputs have not been regenerated with this corrected loader. This release establishes checkpoint compatibility, rather than revalidating all historical numerical results; it does not establish which historical runs used the older public loader. GPU image generation was not rerun for release validation. Use the current code repository when loading these weights.
Intended use and limitations
Use these components for research into relative object scale correction and image editing. The correction pipeline uses segmentation, depth estimates, physical-scale priors, and optional API-generated plans; its results can inherit errors or biases from those components and may alter identities, composition, or visual quality. A scale-corrected output is not a physical measurement. The checkpoint directory identifier does not establish training duration, compute cost, or a complete training recipe.
License and attribution
Weights: FLUX.1 [dev] Non-Commercial License. See LICENSE.md and NOTICE. Rights to use the upstream FLUX models and derivatives are granted directly by Black Forest Labs under that license. This release modifies FLUX-based components through the Rescale adapter and ControlNet checkpoint; it does not grant a new commercial license to the upstream models.
The implementation builds on Insert-Anything and Shakker-Labs/FLUX.1-dev-ControlNet-Depth. Upstream source revisions are recorded in UPSTREAM_SOURCES.json. The MIT notice for Insert-Anything is preserved under third_party/. GenScale code is separately MIT licensed; the benchmark dataset is separately CC BY 4.0. Those licenses do not replace the checkpoint's upstream model terms.
Please cite CITATION.bib.
- Downloads last month
- 2
Model tree for lingxiao2049/Rescale
Base model
black-forest-labs/FLUX.1-dev