Commit 6c09441b authored by Qirui Sun's avatar Qirui Sun
Browse files

Update controlnet_ui_group.py

No related merge requests found
Showing with 4 additions and 2 deletions
+4 -2
......@@ -445,9 +445,11 @@ class ControlNetUiGroup(object):
# JIAHUI'S MODIFY
with gr.Row():
import os
def input_change(image_dir):
def input_change(cache_path):
try:
img_ids = [name for name in os.listdir(image_dir)]
assert os.path.splitext(cache_path)[1] == '.pt'
image_dir = os.path.dirname(cache_path)
img_ids = [name for name in os.listdir(image_dir) if name.split('.')[1]!='pt']
info = f"total num:{len(img_ids)}\n" + '\n'.join(img_ids)
except FileNotFoundError as e:
info = f"Error: This path is not valid ==> {e}"
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment