From 787042042150e29759ff278558c62e28cefcce7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=96=B5=E5=93=A9=E4=B8=AA=E5=92=AA?= Date: Mon, 29 Apr 2024 01:44:39 +0800 Subject: [PATCH 1/3] Update README.md --- README.md | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 2ca99c9..8b82c68 100644 --- a/README.md +++ b/README.md @@ -1,34 +1,41 @@ ![Image Description](res/1.png) # ComfyUI-Prompt-MZ +基于llama.cpp的一些和提示词相关的节点,目前包括美化提示词和类似clip-interrogator的图片反推 + Use llama.cpp to assist in generating some nodes related to prompt words, including beautifying prompt words and image recognition similar to clip-interrogator - + +## Recent changes +* [2024-04-28] 新增Phi-3-mini节点 (add Phi-3-mini node) ## Installation 1. Clone this repo into `custom_nodes` folder. 2. Restart ComfyUI. ## Nodes -+ LLama3CLIPTextEncode ++ CLIPTextEncode (Phi-3) + + ![image](https://github.com/MinusZoneAI/ComfyUI-Prompt-MZ/assets/5035199/c4b97aeb-23c0-4cf1-a6a5-d259fdf83f6e) + + ++ CLIPTextEncode (LLama3) ![image](https://github.com/MinusZoneAI/ComfyUI-Prompt-MZ/assets/5035199/40da75ab-46db-4f38-9d8e-b7f9184f77fa) -+ LLavaImageInterrogator ++ ImageInterrogator (LLava) ![image](https://github.com/MinusZoneAI/ComfyUI-Prompt-MZ/assets/5035199/f397c432-c2f7-4d48-9b95-2031cfb19e8c) Enable parameter sd_format ![image](https://github.com/MinusZoneAI/ComfyUI-Prompt-MZ/assets/5035199/4d2cf65d-e8a3-4dfa-b735-9d591638028c) - - + LLamaCPPOptions ![image](https://github.com/MinusZoneAI/ComfyUI-Prompt-MZ/assets/5035199/143d2055-31fa-4130-9937-1c252bda9c73) -+ BaseLLamaCPPCLIPTextEncode (You can directly pass in the model path) -+ BaseLLavaImageInterrogator (You can directly pass in the model path) ++ BaseLLamaCPPCLIPTextEncode (可以手动传入模型路径/You can directly pass in the model path) ++ BaseLLavaImageInterrogator (可以手动传入模型路径/You can directly pass in the model path) From d12506b5a9dd817b4540c3231ac2b3a3eeda9153 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=96=B5=E5=93=A9=E4=B8=AA=E5=92=AA?= Date: Mon, 29 Apr 2024 01:47:03 +0800 Subject: [PATCH 2/3] Update README.md --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 8b82c68..3fa8d72 100644 --- a/README.md +++ b/README.md @@ -30,8 +30,9 @@ Use llama.cpp to assist in generating some nodes related to prompt words, includ ![image](https://github.com/MinusZoneAI/ComfyUI-Prompt-MZ/assets/5035199/4d2cf65d-e8a3-4dfa-b735-9d591638028c) + LLamaCPPOptions - - ![image](https://github.com/MinusZoneAI/ComfyUI-Prompt-MZ/assets/5035199/143d2055-31fa-4130-9937-1c252bda9c73) + + ![image](https://github.com/MinusZoneAI/ComfyUI-Prompt-MZ/assets/5035199/256483e0-c3b7-4d04-82f4-f71f7d9584c9) + + BaseLLamaCPPCLIPTextEncode (可以手动传入模型路径/You can directly pass in the model path) From d5c64e056a3540faf69151f2785f76c026f939f6 Mon Sep 17 00:00:00 2001 From: wailovet Date: Mon, 29 Apr 2024 02:06:39 +0800 Subject: [PATCH 3/3] 'update' --- mz_llama_cpp.py | 2 +- mz_llava.py | 13 ++++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/mz_llama_cpp.py b/mz_llama_cpp.py index 93b4c42..0fd7156 100644 --- a/mz_llama_cpp.py +++ b/mz_llama_cpp.py @@ -350,7 +350,7 @@ def llava_cpp_messages(model_file, chat_handler, messages, options={}): if options is None: options = {} options["logits_all"] = True - options["n_ctx"] = max(2048, options.get("n_ctx", 2048)) + options["n_ctx"] = max(4096, options.get("n_ctx", 4096)) return llama_cpp_messages(model_file, chat_handler, messages, options) diff --git a/mz_llava.py b/mz_llava.py index a1d8577..06aa031 100644 --- a/mz_llava.py +++ b/mz_llava.py @@ -9,7 +9,9 @@ import mz_prompts LLava_models = [ - "ggml_llava-v1.5-7b/ggml-model-q4_k.gguf", + "llava-1.6-mistral-7b-gguf/llava-v1.6-mistral-7b.Q5_K_M.gguf", + "llava-v1.6-vicuna-13b-gguf/llava-v1.6-vicuna-13b.Q5_K_M.gguf", + "ggml_llava-v1.5-7b/ggml-model-q4_k.gguf", "ggml_llava-v1.5-7b/ggml-model-q5_k.gguf", "ggml_llava-v1.5-7b/ggml-model-f16.gguf", "ggml_bakllava-1/ggml-model-q4_k.gguf", @@ -18,12 +20,15 @@ LLava_models = [ ] LLava_mmproj_models = [ + "llava-1.6-mistral-7b-gguf/mmproj-model-f16.gguf", + "llava-v1.6-vicuna-13b-gguf/mmproj-model-f16.gguf", "ggml_llava-v1.5-7b/mmproj-model-f16.gguf", "ggml_bakllava-1/mmproj-model-f16.gguf", ] huggingface_models_map = { + "llava-v1.6-vicuna-13b-gguf": "cjpais", "llava-1.6-mistral-7b-gguf": "cjpais", "ggml_llava-v1.5-7b": "mys", "ggml_llava-v1.5-13b": "mys", @@ -149,17 +154,19 @@ def base_image_interrogator(args_dict): schema = mz_llama_cpp.get_schema_obj( keys_type={ - "short_desc": mz_llama_cpp.get_schema_base_type("string"), + "short_describes": mz_llama_cpp.get_schema_base_type("string"), "subject_tags": mz_llama_cpp.get_schema_array("string"), "action_tags": mz_llama_cpp.get_schema_array("string"), "light_tags": mz_llama_cpp.get_schema_array("string"), + "scenes_tags": mz_llama_cpp.get_schema_array("string"), "other_tags": mz_llama_cpp.get_schema_array("string"), }, required=[ - "short_desc", + "short_describes", "subject_tags", "action_tags", "light_tags", + "scenes_tags", "other_tags", ] )