Views
No views yet
[!NOTE] If you encounter pipeline loading failure or unexpected output, please contact bili_sakura@zju.edu.cn.
diffusers.DiffusionPipeline.from_pretrained().model_index.json is set to the default text-to-image pipeline (DiffusionSatPipeline) so DiffusionPipeline.from_pretrained() works out of the box. The ControlNet variant is loaded via custom_pipeline plus the controlnet subfolder, as shown below.pipeline_diffusionsat.py: Standard text-to-image pipeline with DiffusionSat metadata support.pipeline_diffusionsat_controlnet.py: ControlNet pipeline with DiffusionSat metadata and conditional metadata support.ckpt/diffusionsat/) should contain the standard diffusers components (unet, vae, scheduler, etc.). You can reference these pipeline files directly from this directory or copy them to your checkpoint folder.pipeline_diffusionsat.py for standard generation.1import torch
2from diffusers import DiffusionPipeline
3
4# Load pipeline
5pipe = DiffusionPipeline.from_pretrained(
6 "path/to/ckpt/diffusionsat",
7 custom_pipeline="./pipeline_diffusionsat.py", # Path to this file
8 torch_dtype=torch.float16,
9 trust_remote_code=True,
10)
11pipe = pipe.to("cuda")
12
13# Optional: Metadata (normalized lat, lon, timestamp, GSD, etc.)
14# metadata = [0.5, -0.3, 0.7, 0.2, 0.1, 0.0, 0.5]
15
16# Generate
17image = pipe(
18 "satellite image of farmland",
19 metadata=None, # Optional
20 height=256,
21 width=256,
22 num_inference_steps=30,
23).images[0]