Skip to content

bxuanz/SHARP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

8 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

SHARP logo

Spectrum-aware Highly-dynamic Adaptation for Resolution Promotion in Remote Sensing Synthesis

Training-free large-scale remote sensing text-to-image synthesis with an RS-adapted FLUX prior and dynamic positional adaptation.

Weights Paper Task Mode Backend Python

🌍 Overview

SHARP is a training-free resolution promotion framework for remote sensing text-to-image synthesis. Built on top of an RS-adapted FLUX prior, it applies stronger positional extrapolation during early layout formation and progressively relaxes it during late detail recovery, enabling robust large-scale generation while preserving the dense high-frequency structures that are especially important in remote sensing imagery.

In short: SHARP helps generate sharper, larger, and more structure-faithful remote sensing images without extra training.

The fine-tuned checkpoint is available at: BxuanZ/FLUX-RS

πŸ”₯ Highlights

  • ✨ Training-free resolution promotion for remote sensing image synthesis
  • πŸ›°οΈ Spectrum-aware dynamic positional adaptation aligned with diffusion denoising
  • πŸ“ Resolution-agnostic generation across square and rectangular high resolutions
  • ⚑ FLUX-based implementation powered by an RS-specialized generative prior
  • 🧩 Single-GPU and multi-GPU entry points for both quick demos and batch evaluation

πŸ–ΌοΈ Method Snapshot

The figure below gives a quick look at the SHARP framework and its design intuition:

SHARP structure

πŸ“’ Current Status

  • βœ… SHARP inference code
  • βœ… Fine-tuned RS-FLUX weights
  • ❌ Training data

🧭 Repository Map

Click to expand the project layout
SHARP/
β”œβ”€β”€ assets/
β”‚   └── logo.png
β”œβ”€β”€ checkpoints/
β”‚   └── .gitkeep
β”œβ”€β”€ docs/
β”‚   └── structure.png
β”œβ”€β”€ flux/
β”‚   β”œβ”€β”€ pipeline_flux.py
β”‚   └── transformer_flux.py
β”œβ”€β”€ LICENSE
β”œβ”€β”€ README.md
β”œβ”€β”€ requirements.txt
β”œβ”€β”€ rs_t2i_eval_prompts_100.txt
β”œβ”€β”€ run_sharp.py
β”œβ”€β”€ run_sharp.sh
└── run_sharp_multi_gpu.py

πŸ“¦ What Is Included

File Description
run_sharp.py Official SHARP single-GPU generation entry
run_sharp_multi_gpu.py Multi-GPU batch launcher for multi-scale generation
run_sharp.sh Thin shell wrapper around run_sharp.py
flux/pipeline_flux.py SHARP pipeline implementation
flux/transformer_flux.py SHARP transformer with dynamic positional adaptation
rs_t2i_eval_prompts_100.txt Example prompt list for quick evaluation
checkpoints/ Default place for storing local checkpoints

πŸ›  Installation

1. Create the environment

conda create -n sharp python=3.10
conda activate sharp

2. Install dependencies

pip install -r requirements.txt

3. Main dependencies

torch
torchvision
diffusers
transformers
accelerate
sentencepiece

πŸ“₯ Checkpoints

The recommended checkpoint is the RS-adapted FLUX model hosted on Hugging Face:

By default, SHARP looks for checkpoints under:

checkpoints/

You can use either workflow below:

  • Place the downloaded FLUX-RS model directory under checkpoints/, then run SHARP without changing --ckpt_path
  • Pass the checkpoint directory explicitly with --ckpt_path /path/to/your_checkpoint_dir

A valid checkpoint directory should contain a transformer/ subfolder, for example:

checkpoints/<your_checkpoint_dir>/

πŸš€ Quick Start

1. Generate from a single prompt

bash run_sharp.sh \
  --prompt "A satellite image of a rural market town with dense shop blocks, a bus station, surrounding crop fields, narrow feeder roads, and mixed residential and commercial parcels." \
  --width 1024 \
  --height 1024

2. Generate from a prompt file

python run_sharp.py \
  --prompt_file rs_t2i_eval_prompts_100.txt \
  --width 1024 \
  --height 1536 \
  --ckpt_path checkpoints/<your_checkpoint_dir> \
  --save_prefix sharp_eval \
  --out_dir sharp_outputs

3. Launch multi-GPU evaluation

python run_sharp_multi_gpu.py \
  --gpus 0 1 2 \
  --prompt_file rs_t2i_eval_prompts_100.txt \
  --ckpt_path checkpoints/<your_checkpoint_dir> \
  --scales 1024x1024 1764x1764 1024x1536 1920x1024

βš™οΈ Helpful Notes

  • SHARP uses one fixed inference path, so no method switch is needed.
  • The default single-GPU output directory is sharp_outputs/.
  • The default multi-GPU output directory is sharp_outputs_eval/.
  • run_sharp_multi_gpu.py will auto-detect GPUs when --gpus is not provided.
  • If --ckpt_path points to checkpoints/, SHARP can auto-discover the model only when exactly one valid checkpoint directory exists there.
  • For FLUX latent packing, image sizes are ideally divisible by 16. Otherwise, the effective generated size may be rounded down internally.
  • --skip_existing is useful for resuming long batch jobs without re-generating finished outputs.

πŸ§ͺ Script Entry Points

bash run_sharp.sh
python run_sharp.py --help
python run_sharp_multi_gpu.py --help

These entry points were sanity-checked with --help.

πŸ™ Acknowledgement

SHARP is built on an RS-adapted FLUX prior and includes custom remote sensing generation utilities for practical large-resolution synthesis.

πŸ“š Citation

If you find SHARP useful in your research, please cite our paper:

@misc{zhao2026sharpspectrumawarehighlydynamicadaptation,
      title={SHARP: Spectrum-aware Highly-dynamic Adaptation for Resolution Promotion in Remote Sensing Synthesis},
      author={Bingxuan Zhao and Qing Zhou and Chuang Yang and Qi Wang},
      year={2026},
      eprint={2603.21783},
      archivePrefix={arXiv},
      primaryClass={cs.CV},
      url={https://arxiv.org/abs/2603.21783},
}

πŸ“Œ License

This project is released under the MIT License.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors