diff --git a/README.md b/README.md index 2ca99c9..6dc03a7 100644 --- a/README.md +++ b/README.md @@ -1,34 +1,44 @@ ![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-30] 添加llava-v1.6-vicuna-13b (add llava-v1.6-vicuna-13b) +* [2024-04-30] 添加翻译 +* [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) + ![image](https://github.com/MinusZoneAI/ComfyUI-Prompt-MZ/assets/5035199/256483e0-c3b7-4d04-82f4-f71f7d9584c9) -+ 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) diff --git a/mz_llama_cpp.py b/mz_llama_cpp.py index 3214097..03c03e9 100644 --- a/mz_llama_cpp.py +++ b/mz_llama_cpp.py @@ -351,7 +351,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 eb3a28c..06aa031 100644 --- a/mz_llava.py +++ b/mz_llava.py @@ -9,9 +9,9 @@ import mz_prompts LLava_models = [ - "llava-1.6-mistral-7b-gguf/llava-1.6-mistral-7b.Q5_K_M.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-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", @@ -154,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", ] ) diff --git a/mz_prompt_utils.py b/mz_prompt_utils.py index 3b35e3d..ec573d5 100644 --- a/mz_prompt_utils.py +++ b/mz_prompt_utils.py @@ -588,7 +588,7 @@ modelscope_models_map = { "output": "modelscope_models/llava-v1.6-vicuna-13b-gguf/mmproj-model-f16.gguf", "SHA256": "9860fbc162d6df40d12f32211aed11ab4826e16e473e6fff595496b9943872e2" }, - "llava-1.6-mistral-7b-gguf/llava-1.6-mistral-7b.Q5_K_M.gguf": { + "llava-1.6-mistral-7b-gguf/llava-v1.6-mistral-7b.Q5_K_M.gguf": { "url": "https://www.modelscope.cn/api/v1/models/wailovet/MinusZoneAIModels/repo?Revision=master&FilePath=llava-1.6-mistral-7b-gguf%2Fllava-v1.6-mistral-7b.Q5_K_M.gguf", "output": "modelscope_models/llava-1.6-mistral-7b-gguf/llava-v1.6-mistral-7b.Q5_K_M.gguf", "SHA256": "b1d37fc65ecb80aa8f1ce185bf4d7605bc3c5cc5bcc77a160c3a1b0377631112",