Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -13,6 +13,8 @@ from replace_bg.utilities import resize_image, remove_bg_from_image, paste_fg_ov
|
|
13 |
controlnet = ControlNetModel.from_pretrained("briaai/BRIA-2.3-ControlNet-BG-Gen", torch_dtype=torch.float16)
|
14 |
vae = AutoencoderKL.from_pretrained("madebyollin/sdxl-vae-fp16-fix", torch_dtype=torch.float16)
|
15 |
pipe = StableDiffusionXLControlNetPipeline.from_pretrained("briaai/BRIA-2.3", controlnet=controlnet, torch_dtype=torch.float16, vae=vae).to('cuda:0')
|
|
|
|
|
16 |
pipe.scheduler = EulerAncestralDiscreteScheduler(
|
17 |
beta_start=0.00085,
|
18 |
beta_end=0.012,
|
@@ -31,6 +33,7 @@ def generate_(prompt, negative_prompt, control_tensor, num_steps, controlnet_con
|
|
31 |
controlnet_conditioning_scale=float(controlnet_conditioning_scale),
|
32 |
num_inference_steps=num_steps,
|
33 |
image = control_tensor,
|
|
|
34 |
generator=generator
|
35 |
).images[0]
|
36 |
|
|
|
13 |
controlnet = ControlNetModel.from_pretrained("briaai/BRIA-2.3-ControlNet-BG-Gen", torch_dtype=torch.float16)
|
14 |
vae = AutoencoderKL.from_pretrained("madebyollin/sdxl-vae-fp16-fix", torch_dtype=torch.float16)
|
15 |
pipe = StableDiffusionXLControlNetPipeline.from_pretrained("briaai/BRIA-2.3", controlnet=controlnet, torch_dtype=torch.float16, vae=vae).to('cuda:0')
|
16 |
+
pipe.load_lora_weights(lora_model_path, weight_name="77d3c43e-96be-4ecf-b102-4acf0d1abe09_4092_678_webui.safetensors")
|
17 |
+
|
18 |
pipe.scheduler = EulerAncestralDiscreteScheduler(
|
19 |
beta_start=0.00085,
|
20 |
beta_end=0.012,
|
|
|
33 |
controlnet_conditioning_scale=float(controlnet_conditioning_scale),
|
34 |
num_inference_steps=num_steps,
|
35 |
image = control_tensor,
|
36 |
+
cross_attention_kwargs={"scale": 0.9},
|
37 |
generator=generator
|
38 |
).images[0]
|
39 |
|