Views
No views yet
1git clone https://github.com/huggingface/diffusers.git
2cd diffusers && git checkout v0.31.0 && pip install -e .RCDGenSDPipeline.py from the GitHub repo into your diffusers installation:cp RCDGenSDPipeline.py /path/to/diffusers/src/diffusers/pipelines/stable_diffusion/1import torch
2from PIL import Image
3from diffusers.pipelines.stable_diffusion.RCDGenSDPipeline import StableDiffusionInstructPix2PixPipeline
4from diffusers import UNet2DConditionModel
5
6# Load pipeline
7pipe = StableDiffusionInstructPix2PixPipeline.from_pretrained(
8 "yilmazkorkmaz/RCDGen",
9 torch_dtype=torch.float16
10).to("cuda")
11
12# Load EMA UNet (recommended)
13unet = UNet2DConditionModel.from_pretrained(
14 "yilmazkorkmaz/RCDGen",
15 subfolder="unet_ema",
16 torch_dtype=torch.float16
17)
18pipe.unet = unet.cuda()
19
20# Generate
21image = Image.open("pre_change_image.png").convert("RGB")
22output = pipe(
23 "change in building",
24 image=image,
25 num_inference_steps=100,
26 image_guidance_scale=1.5,
27 guidance_scale=7.0,
28).images
29
30post_image = output[0][0] # Generated post-change image
31change_mask = output[1][0] # Binary change masknon-changebuildinglow vegetationmedium vegetationtreewater bodiesnon-vegetated ground surfaceplaygroundimpervious surfacebare ground"change in building", "change in water bodies", etc.1@article{korkmaz2025referring,
2 title={Referring Change Detection in Remote Sensing Imagery},
3 author={Korkmaz, Yilmaz and Paranjape, Jay N and de Melo, Celso M and Patel, Vishal M},
4 journal={arXiv preprint arXiv:2512.11719},
5 year={2025}
6}