John6666 commited on
Commit
ab9c658
β€’
1 Parent(s): fe9a742

Upload 2 files

Browse files
Files changed (2) hide show
  1. app.py +6 -2
  2. mod.py +2 -0
app.py CHANGED
@@ -132,8 +132,8 @@ def generate_image(prompt_mash, steps, seed, cfg_scale, width, height, lora_scal
132
  global controlnet
133
  global controlnet_union
134
  try:
135
- good_vae.to("cuda")
136
- taef1.to("cuda")
137
  pipe.to("cuda")
138
  generator = torch.Generator(device="cuda").manual_seed(seed)
139
 
@@ -338,6 +338,10 @@ css = '''
338
  .card_internal{display: flex;height: 100px;margin-top: .5em}
339
  .card_internal img{margin-right: 1em}
340
  .styler{--form-gap-width: 0px !important}
 
 
 
 
341
  #model-info {text-align: center; !important}
342
  '''
343
  with gr.Blocks(theme='Nymbo/Nymbo_Theme', fill_width=True, css=css) as app:
 
132
  global controlnet
133
  global controlnet_union
134
  try:
135
+ #good_vae.to("cuda")
136
+ #taef1.to("cuda")
137
  pipe.to("cuda")
138
  generator = torch.Generator(device="cuda").manual_seed(seed)
139
 
 
338
  .card_internal{display: flex;height: 100px;margin-top: .5em}
339
  .card_internal img{margin-right: 1em}
340
  .styler{--form-gap-width: 0px !important}
341
+ #progress{height:30px}
342
+ #progress .generating{display:none}
343
+ .progress-container {width: 100%;height: 30px;background-color: #f0f0f0;border-radius: 15px;overflow: hidden;margin-bottom: 20px}
344
+ .progress-bar {height: 100%;background-color: #4f46e5;width: calc(var(--current) / var(--total) * 100%);transition: width 0.5s ease-in-out}
345
  #model-info {text-align: center; !important}
346
  '''
347
  with gr.Blocks(theme='Nymbo/Nymbo_Theme', fill_width=True, css=css) as app:
mod.py CHANGED
@@ -75,6 +75,8 @@ def is_repo_exists(repo_id):
75
 
76
  def clear_cache():
77
  torch.cuda.empty_cache()
 
 
78
  gc.collect()
79
 
80
 
 
75
 
76
  def clear_cache():
77
  torch.cuda.empty_cache()
78
+ torch.cuda.reset_max_memory_allocated()
79
+ torch.cuda.reset_peak_memory_stats()
80
  gc.collect()
81
 
82