multimodalart HF staff commited on
Commit
b111852
1 Parent(s): cd8142c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -19,13 +19,14 @@ pipe = FluxControlNetInpaintingPipeline.from_pretrained(
19
  controlnet=controlnet,
20
  transformer=transformer,
21
  torch_dtype=torch.bfloat16
22
- ).to("cuda")
23
  repo_name = "ByteDance/Hyper-SD"
24
  ckpt_name = "Hyper-FLUX.1-dev-8steps-lora.safetensors"
25
  pipe.load_lora_weights(hf_hub_download(repo_name, ckpt_name))
26
  pipe.fuse_lora(lora_scale=0.125)
27
  pipe.transformer.to(torch.bfloat16)
28
  pipe.controlnet.to(torch.bfloat16)
 
29
 
30
  def can_expand(source_width, source_height, target_width, target_height, alignment):
31
  if alignment in ("Left", "Right") and source_width >= target_width:
 
19
  controlnet=controlnet,
20
  transformer=transformer,
21
  torch_dtype=torch.bfloat16
22
+ )
23
  repo_name = "ByteDance/Hyper-SD"
24
  ckpt_name = "Hyper-FLUX.1-dev-8steps-lora.safetensors"
25
  pipe.load_lora_weights(hf_hub_download(repo_name, ckpt_name))
26
  pipe.fuse_lora(lora_scale=0.125)
27
  pipe.transformer.to(torch.bfloat16)
28
  pipe.controlnet.to(torch.bfloat16)
29
+ pipe.enable_model_cpu_offload()
30
 
31
  def can_expand(source_width, source_height, target_width, target_height, alignment):
32
  if alignment in ("Left", "Right") and source_width >= target_width: