ktrndy commited on
Commit
55b7ae0
·
verified ·
1 Parent(s): 4e30655

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -37,6 +37,7 @@ def get_lora_sd_pipeline(
37
 
38
  pipe = StableDiffusionPipeline.from_pretrained(base_model_name_or_path, torch_dtype=dtype).to(device)
39
  pipe.unet = PeftModel.from_pretrained(pipe.unet, unet_sub_dir, adapter_name=adapter_name)
 
40
 
41
  if os.path.exists(text_encoder_sub_dir):
42
  pipe.text_encoder = PeftModel.from_pretrained(
@@ -50,7 +51,7 @@ def get_lora_sd_pipeline(
50
  pipe.to(device)
51
  return pipe
52
 
53
-
54
  def encode_prompt(prompt, tokenizer, text_encoder):
55
  text_inputs = tokenizer(
56
  prompt,
@@ -158,7 +159,7 @@ with gr.Blocks(css=css, fill_height=True) as demo:
158
  step=0.1,
159
  value=7.0, # Replace with defaults that work for your model
160
  )
161
-
162
  lora_scale = gr.Slider(
163
  label="LoRA scale",
164
  minimum=0.0,
 
37
 
38
  pipe = StableDiffusionPipeline.from_pretrained(base_model_name_or_path, torch_dtype=dtype).to(device)
39
  pipe.unet = PeftModel.from_pretrained(pipe.unet, unet_sub_dir, adapter_name=adapter_name)
40
+ pipe.unet.set_adapter(adapter_name)
41
 
42
  if os.path.exists(text_encoder_sub_dir):
43
  pipe.text_encoder = PeftModel.from_pretrained(
 
51
  pipe.to(device)
52
  return pipe
53
 
54
+
55
  def encode_prompt(prompt, tokenizer, text_encoder):
56
  text_inputs = tokenizer(
57
  prompt,
 
159
  step=0.1,
160
  value=7.0, # Replace with defaults that work for your model
161
  )
162
+ with gr.Row():
163
  lora_scale = gr.Slider(
164
  label="LoRA scale",
165
  minimum=0.0,