Views
No views yet
1import torch
2from diffusers import Flux2KleinPipeline
3from PIL import Image
4
5pipeline = Flux2KleinPipeline.from_pretrained(
6 "black-forest-labs/FLUX.2-klein-base-9B",
7 torch_dtype=torch.bfloat16,
8 low_cpu_mem_usage=False
9).to("cuda")
10pipeline.load_lora_weights(
11 "fal/virtual-tryoff-lora",
12 weight_name="virtual-tryoff-lora_diffusers.safetensors",
13 adapter_name="vtoff"
14)
15pipeline.set_adapters("vtoff", adapter_weights=1.0)
16pipeline.fuse_lora(adapter_names=["vtoff"], lora_scale=1.0)
17
18image = pipeline(
19 image=Image.open("<your_image>.jpg"),
20 prompt="TRYOFF extract the full outfit over a white background, product photography style. NO HUMAN VISIBLE (the garments maintain their 3D form like an invisible mannequin).",
21 height=1024,
22 width=768,
23 num_inference_steps=28,
24 guidance_scale=5.0,
25 generator=torch.Generator("cuda").manual_seed(42),
26).images[0]1024x1024