Fix for translator
This commit is contained in:
@@ -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,
|
||||
|
||||
+1
-1
@@ -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"]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user