Views
No views yet
young_lora.safetensors: Young age group (10-20 years)old_lora.safetensors: Old age group (70-80 years)1from diffusers import StableDiffusionXLImg2ImgPipeline
2import torch
3
4# Load base model
5pipe = StableDiffusionXLImg2ImgPipeline.from_pretrained(
6 "stabilityai/stable-diffusion-xl-base-1.0",
7 torch_dtype=torch.float16
8).to("cuda")
9
10# Load young LoRA
11pipe.load_lora_weights("ShubhamBaghel307/agebooth-loras", weight_name="young_lora.safetensors")
12young_image = pipe(prompt="young person", image=input_face).images[0]
13
14# Load old LoRA
15pipe.load_lora_weights("ShubhamBaghel307/agebooth-loras", weight_name="old_lora.safetensors")
16old_image = pipe(prompt="elderly person", image=input_face).images[0]1# Load both LoRAs
2young_state = torch.load("young_lora.safetensors")
3old_state = torch.load("old_lora.safetensors")
4
5# Interpolate (alpha=0.5 for middle age)
6alpha = 0.5
7mixed_state = {
8 k: alpha * young_state[k] + (1 - alpha) * old_state[k]
9 for k in young_state.keys()
10}1@misc{agebooth2025,
2 title={AgeBooth: Identity-Preserved Age Transformation},
3 author={Baghel, Shubham},
4 year={2025}
5}