From a0a5138154db03c4deae0a0c4a22f6f5359d9140 Mon Sep 17 00:00:00 2001 From: Level Pixel Dev Date: Mon, 9 Dec 2024 05:10:09 +0600 Subject: [PATCH] Fix for translator --- nodes/text/text_utils_LP.py | 10 +++++----- pyproject.toml | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/nodes/text/text_utils_LP.py b/nodes/text/text_utils_LP.py index c7fabfa..a02750e 100644 --- a/nodes/text/text_utils_LP.py +++ b/nodes/text/text_utils_LP.py @@ -83,16 +83,16 @@ class TextTranslate: FUNCTION = "text_translate" CATEGORY = "LevelPixel/Text" - def text_translate(self, prompt): - if prompt.strip(): - detected_lang = detect(prompt) + def text_translate(self, text): + if text.strip(): + detected_lang = detect(text) if detected_lang != 'en': try: translator = GoogleTranslator(source='auto', target='en') - prompt = translator.translate(prompt) + text = translator.translate(text) except Exception as e: print(f"Translation error: {e}") - return (prompt,) + return (text,) NODE_CLASS_MAPPINGS = { "TextChoiceParser|LP": TextChoiceParser, diff --git a/pyproject.toml b/pyproject.toml index eceda66..1542947 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [project] name = "comfyui_level_pixel" description = "Various nodes of the Level Pixel company. Includes convenient advanced nodes for working with images from folders; counting files in a folder; cleaning memory; tag filters. Model Unloader, LLM Unloader (GGUF unloaders), Free memory, Tag Filters, Tag Category Filters, Tag Choice Parser, File counter, Image Loader From Path (with counters), Image Remove Background based on RemBG, Autotagger." -version = "1.1.0" +version = "1.1.1" license = { file = "LICENSE" } dependencies = ["torch>=2.0.1", "torchvision>=0.15.2", "pillow>=9.4.0", "numpy", "matplotlib", "scikit-build-core>=0.10.7", "rembg>=2.0.59", "onnxruntime-gpu>=1.20.0", "onnxruntime>=1.20.0", "googletrans", "langdetect", "httpcore", "deep_translator"]