rhfeiyang commited on
Commit
0026aa2
·
1 Parent(s): cf66859
Files changed (1) hide show
  1. hf_demo.py +2 -2
hf_demo.py CHANGED
@@ -42,7 +42,7 @@ def demo_inference_gen(adapter_choice:str, prompt:str, samples:int=1,seed:int=0,
42
 
43
  prompts = [prompt]*samples
44
  infer_loader = get_validation_dataloader(prompts,num_workers=0)
45
- network = get_lora_network(pipe.unet, adapter_path)["network"]
46
  pred_images = inference(network, pipe.tokenizer, pipe.text_encoder, pipe.vae, pipe.unet, pipe.scheduler, infer_loader,
47
  height=512, width=512, scales=[1.0],
48
  save_dir=None, seed=seed,steps=steps, guidance_scale=guidance_scale,
@@ -52,7 +52,7 @@ def demo_inference_gen(adapter_choice:str, prompt:str, samples:int=1,seed:int=0,
52
  @spaces.GPU
53
  def demo_inference_stylization(adapter_path:str, prompts:list, image:list, start_noise=800,seed:int=0):
54
  infer_loader = get_validation_dataloader(prompts, image,num_workers=0)
55
- network = get_lora_network(pipe.unet, adapter_path,"all_up")["network"]
56
  pred_images = inference(network, pipe.tokenizer, pipe.text_encoder, pipe.vae, pipe.unet, pipe.scheduler, infer_loader,
57
  height=512, width=512, scales=[0.,1.],
58
  save_dir=None, seed=seed,steps=20, guidance_scale=7.5,
 
42
 
43
  prompts = [prompt]*samples
44
  infer_loader = get_validation_dataloader(prompts,num_workers=0)
45
+ network = get_lora_network(pipe.unet, adapter_path, weight_dtype=dtype)["network"]
46
  pred_images = inference(network, pipe.tokenizer, pipe.text_encoder, pipe.vae, pipe.unet, pipe.scheduler, infer_loader,
47
  height=512, width=512, scales=[1.0],
48
  save_dir=None, seed=seed,steps=steps, guidance_scale=guidance_scale,
 
52
  @spaces.GPU
53
  def demo_inference_stylization(adapter_path:str, prompts:list, image:list, start_noise=800,seed:int=0):
54
  infer_loader = get_validation_dataloader(prompts, image,num_workers=0)
55
+ network = get_lora_network(pipe.unet, adapter_path, weight_dtype=dtype)["network"]
56
  pred_images = inference(network, pipe.tokenizer, pipe.text_encoder, pipe.vae, pipe.unet, pipe.scheduler, infer_loader,
57
  height=512, width=512, scales=[0.,1.],
58
  save_dir=None, seed=seed,steps=20, guidance_scale=7.5,