John6666 commited on
Commit
36c414c
·
verified ·
1 Parent(s): 08abe29

Upload 2 files

Browse files
Files changed (2) hide show
  1. app.py +3 -3
  2. constants.py +5 -10
app.py CHANGED
@@ -701,7 +701,7 @@ def sd_gen_generate_pipeline(*args):
701
  None if item == "None" or item == "" else item # MOD
702
  for item in [args[7], args[9], args[11], args[13], args[15], args[17], args[19]]
703
  ]
704
- lora_status = [None] * sd_gen.model.num_loras
705
 
706
  msg_load_lora = "Updating LoRAs in GPU..."
707
  if load_lora_cpu:
@@ -1479,7 +1479,7 @@ with gr.Blocks(theme=args.theme, elem_id="main", fill_width=True, fill_height=Fa
1479
 
1480
  def change_visibility_canvas():
1481
  return gr.update(visible=True, interactive=True), gr.update(visible=False)
1482
- show_canvas.click(change_visibility_canvas, [], [image_base, show_canvas])
1483
 
1484
  invert_mask = gr.Checkbox(value=False, label="Invert mask")
1485
  btn = gr.Button("Create mask")
@@ -1493,7 +1493,7 @@ with gr.Blocks(theme=args.theme, elem_id="main", fill_width=True, fill_height=Fa
1493
 
1494
  def send_img(img_source, img_result):
1495
  return img_source, img_result
1496
- btn_send.click(send_img, [img_source, img_result], [image_control, image_mask_gui])
1497
 
1498
  with gr.Tab("PNG Info"):
1499
  with gr.Row():
 
701
  None if item == "None" or item == "" else item # MOD
702
  for item in [args[7], args[9], args[11], args[13], args[15], args[17], args[19]]
703
  ]
704
+ lora_status = [None] * sd_gen.model.num_loras if getattr(sd_gen, "model", None) is not None else 7 # MOD
705
 
706
  msg_load_lora = "Updating LoRAs in GPU..."
707
  if load_lora_cpu:
 
1479
 
1480
  def change_visibility_canvas():
1481
  return gr.update(visible=True, interactive=True), gr.update(visible=False)
1482
+ show_canvas.click(change_visibility_canvas, [], [image_base, show_canvas], show_api=False)
1483
 
1484
  invert_mask = gr.Checkbox(value=False, label="Invert mask")
1485
  btn = gr.Button("Create mask")
 
1493
 
1494
  def send_img(img_source, img_result):
1495
  return img_source, img_result
1496
+ btn_send.click(send_img, [img_source, img_result], [image_control, image_mask_gui], show_api=False)
1497
 
1498
  with gr.Tab("PNG Info"):
1499
  with gr.Row():
constants.py CHANGED
@@ -7,12 +7,13 @@ from stablepy import (
7
  ALL_BUILTIN_UPSCALERS,
8
  IP_ADAPTERS_SD,
9
  IP_ADAPTERS_SDXL,
 
10
  )
11
 
12
  IS_ZERO_GPU = bool(os.getenv("SPACES_ZERO_GPU"))
13
 
14
  # - **Download Models**
15
- DOWNLOAD_MODEL = "https://huggingface.co/TechnoByte/MilkyWonderland/resolve/main/milkyWonderland_v40.safetensors"
16
 
17
  # - **Download VAEs**
18
  DOWNLOAD_VAE = "https://huggingface.co/fp16-guy/anything_kl-f8-anime2_vae-ft-mse-840000-ema-pruned_blessed_clearvae_fp16_cleaned/resolve/main/vae-ft-mse-840000-ema-pruned_fp16.safetensors?download=true"
@@ -321,15 +322,9 @@ DIFFUSERS_CONTROLNET_MODEL = [
321
  # "InstantX/FLUX.1-dev-Controlnet-Canny",
322
  ]
323
 
324
- PROMPT_W_OPTIONS = [
325
- ("Compel format: (word)weight", "Compel"),
326
- ("Classic format: (word:weight)", "Classic"),
327
- ("Classic-original format: (word:weight)", "Classic-original"),
328
- ("Classic-no_norm format: (word:weight)", "Classic-no_norm"),
329
- ("Classic-sd_embed format: (word:weight)", "Classic-sd_embed"),
330
- ("Classic-ignore", "Classic-ignore"),
331
- ("None", "None"),
332
- ]
333
 
334
  WARNING_MSG_VAE = (
335
  "Use the right VAE for your model to maintain image quality. The wrong"
 
7
  ALL_BUILTIN_UPSCALERS,
8
  IP_ADAPTERS_SD,
9
  IP_ADAPTERS_SDXL,
10
+ PROMPT_WEIGHT_OPTIONS_PRIORITY,
11
  )
12
 
13
  IS_ZERO_GPU = bool(os.getenv("SPACES_ZERO_GPU"))
14
 
15
  # - **Download Models**
16
+ DOWNLOAD_MODEL = "https://huggingface.co/zuv0/test/resolve/main/milkyWonderland_v40.safetensors"
17
 
18
  # - **Download VAEs**
19
  DOWNLOAD_VAE = "https://huggingface.co/fp16-guy/anything_kl-f8-anime2_vae-ft-mse-840000-ema-pruned_blessed_clearvae_fp16_cleaned/resolve/main/vae-ft-mse-840000-ema-pruned_fp16.safetensors?download=true"
 
322
  # "InstantX/FLUX.1-dev-Controlnet-Canny",
323
  ]
324
 
325
+ PROMPT_W_OPTIONS = [(pwf, pwf) for pwf in PROMPT_WEIGHT_OPTIONS_PRIORITY]
326
+ PROMPT_W_OPTIONS[0] = ("Classic format: (word:weight)", "Classic")
327
+ PROMPT_W_OPTIONS[1] = ("Compel format: (word)weight", "Compel")
 
 
 
 
 
 
328
 
329
  WARNING_MSG_VAE = (
330
  "Use the right VAE for your model to maintain image quality. The wrong"