Views
No views yet
StableDiffusionInstructPix2PixPipeline (SD 1.5)1pip install -U "huggingface_hub[cli]"
2
3huggingface-cli download nishitanand/sd-image-relighting-model \
4 --repo-type model \
5 --local-dir ./sd-image-relighting-model1import torch
2from PIL import Image
3from diffusers import StableDiffusionInstructPix2PixPipeline
4
5model_id = "nishitanand/sd-image-relighting-model"
6pipe = StableDiffusionInstructPix2PixPipeline.from_pretrained(
7 model_id,
8 torch_dtype=torch.float16,
9).to("cuda")
10pipe.safety_checker = None
11
12image = Image.open("degraded_input.png").convert("RGB")
13instruction = (
14 "Soft window light from the left with warm highlights and gentle shadows "
15 "across the face."
16)
17
18out = pipe(
19 instruction,
20 image=image,
21 num_inference_steps=50,
22 image_guidance_scale=1.5,
23 guidance_scale=7.5,
24).images[0]
25
26out.save("relit.png")1cd inference
2pip install -r requirements.txt
3
4python inference.py \
5 --model_path nishitanand/sd-image-relighting-model \
6 --input_image /path/to/degraded.png \
7 --instruction "Your full-sentence lighting description here." \
8 --output_path ./relit.pngpip install -r training/sd1_5/requirements.txt.model_index.jsonunet/, vae/, text_encoder/, tokenizer/scheduler/, feature_extractor/, safety_checker/checkpoint-* (e.g. checkpoint-13000/) — raw Accelerate training snapshot. from_pretrained / inference / evaluate_models.py load the repository root where model_index.json lives — they do not automatically use checkpoint-*. Point --model_path / --trained_model_path at ./hf_model (or the Hub id), not at checkpoint-*, unless you have re-exported that step as a standalone Diffusers layout.1@article{anand2026learning,
2 title={Learning Illumination Control in Diffusion Models},
3 author={Anand, Nishit and Suri, Manan and Metzler, Christopher and Manocha, Dinesh and Duraiswami, Ramani},
4 journal={arXiv preprint arXiv:2604.24877},
5 year={2026},
6 note={ReALM-GEN @ ICLR 2026}
7}LICENSE at the repo root when mirrored from GitHub). Base Stable Diffusion components remain subject to their original licenses.