diff --git a/README.cn.md b/README.cn.md index b07e4df..1626053 100644 --- a/README.cn.md +++ b/README.cn.md @@ -33,6 +33,7 @@ Stable Diffusion Webui 扩展Civitai助手,用于更轻松的管理和使用Ci 当你下载了新模型之后,只要再次点击扫描按钮即可。已经扫描过的文件不会重复扫描,会自动得到新模型的信息和预览图。无须重启SD webui。 ## 模型卡片 +**(先完成扫描,再使用卡片功能)** 打开SD webui's 内置的 "Extra Network" 页面,显示模型卡片 ![](img/extra_network.jpg) diff --git a/README.md b/README.md index 53cbee0..b7ce5d9 100644 --- a/README.md +++ b/README.md @@ -40,6 +40,7 @@ If a model info file is already exists, it will skip this model. If a model can When you have some new models, just click this button again, to get new model's information and preview images. ## Model Card +**(Use this only after you scaned your models!)** Open SD webui's build-in "Extra Network" tab, to show model cards. ![](img/extra_network.jpg) @@ -70,5 +71,5 @@ Enjoy! * Support subfolders * Check if refresh is needed when clicking "Refresh Civitai Helper" * Add space when adding trigger words -* Add memory optimised shad256 as an option +* Add memory optimised sha256 as an option diff --git a/scripts/civitai_helper.py b/scripts/civitai_helper.py index 6a65968..cbaecd8 100644 --- a/scripts/civitai_helper.py +++ b/scripts/civitai_helper.py @@ -15,12 +15,44 @@ import json import shutil import modules from modules import script_callbacks +from modules import shared # from modules import images # from modules.processing import process_images, Processed # from modules.processing import Processed # from modules.shared import opts, cmd_opts, state +# print for debugging +def printD(msg): + print(f"Civitai Helper: {msg}") + + + +# printD("Current Model folder:") +# if shared.cmd_opts.embeddings_dir: +# printD("ti: " + shared.cmd_opts.embeddings_dir) +# else: +# printD("shared.cmd_opts.embeddings_dir is None") + +# if shared.cmd_opts.hypernetwork_dir: +# printD("hypernetwork_dir: " + shared.cmd_opts.hypernetwork_dir) +# else: +# printD("shared.cmd_opts.embeddings_dir is None") + + +# if shared.cmd_opts.ckpt_dir: +# printD("ckpt_dir: " + shared.cmd_opts.ckpt_dir) +# else: +# printD("shared.cmd_opts.ckpt_dir is None") + + +# if shared.cmd_opts.lora_dir: +# printD("lora_dir: " + shared.cmd_opts.lora_dir) +# else: +# printD("shared.cmd_opts.lora_dir is None") + + + # init model_folders = { @@ -40,10 +72,6 @@ js_actions = ("open_url", "add_trigger_words", "use_preview_prompt") root_path = os.getcwd() -# print for debugging -def printD(msg): - print(f"Civitai Helper: {msg}") - def gen_file_sha256(filname): ''' calculate file sha256 ''' @@ -432,15 +460,15 @@ def on_ui_tabs(): # ====UI==== with gr.Blocks(analytics_enabled=False) as civitai_helper: - # info - gr.Markdown("Civitai Helper's extension tab") - + # info with gr.Row(): skip_nsfw_preview_ckb = gr.Checkbox(label="SKip NSFW Preview images", value=False, elem_id="ch_skip_nsfw_preview_ckb") low_memory_sha_ckb = gr.Checkbox(label="Memory Optimised SHA256", value=False, elem_id="ch_low_memory_sha_ckb") scan_model_btn = gr.Button(value="Scan model", elem_id="ch_scan_model_btn") + gr.Markdown("Check console log window for detail, after clicking Scan button") + # hidden component for js js_msg_txtbox = gr.Textbox(label="Request Msg From Js", visible=False, lines=1, value="", elem_id="ch_js_msg_txtbox") js_open_url_btn = gr.Button(value="Open Model Url", visible=False, elem_id="ch_js_open_url_btn")