From 626fc04911e900d029d7529c86356cd434b0ce7f Mon Sep 17 00:00:00 2001 From: rgthree Date: Wed, 18 Dec 2024 21:23:24 -0500 Subject: [PATCH] Remove saved prompts; not sure they ever worked, and cause issues for some installs. Addresses #398 and #399 --- prestartup_script.py | 5 +++-- py/power_prompt.py | 9 ++++----- py/power_prompt_simple.py | 7 +++---- py/sdxl_power_prompt_postive.py | 9 ++++----- 4 files changed, 14 insertions(+), 16 deletions(-) diff --git a/prestartup_script.py b/prestartup_script.py index e9c04a4..81d81b3 100644 --- a/prestartup_script.py +++ b/prestartup_script.py @@ -1,4 +1,5 @@ import folder_paths -# Add 'saved_prompts' as a folder for Power Prompt node. -folder_paths.folder_names_and_paths['saved_prompts'] = ([], set(['.txt'])) +# Removed Saved Prompts feature; No sure it worked any longer. UI should fail gracefully. +# TODO: See if anyone actually used this. +# folder_paths.folder_names_and_paths['saved_prompts'] = ([], set(['.txt'])) diff --git a/py/power_prompt.py b/py/power_prompt.py index 3d0f216..5527e61 100644 --- a/py/power_prompt.py +++ b/py/power_prompt.py @@ -17,11 +17,10 @@ class RgthreePowerPrompt: @classmethod def INPUT_TYPES(cls): # pylint: disable = invalid-name, missing-function-docstring - SAVED_PROMPTS_FILES = folder_paths.get_filename_list('saved_prompts') - SAVED_PROMPTS_CONTENT = [] - for filename in SAVED_PROMPTS_FILES: - with open(folder_paths.get_full_path('saved_prompts', filename), 'r') as f: - SAVED_PROMPTS_CONTENT.append(f.read()) + # Removed Saved Prompts feature; No sure it worked any longer. UI should fail gracefully, + # TODO: Rip out saved prompt input data + SAVED_PROMPTS_FILES=[] + SAVED_PROMPTS_CONTENT=[] return { 'required': { 'prompt': ('STRING', { diff --git a/py/power_prompt_simple.py b/py/power_prompt_simple.py index 2d3f5b5..4c6221a 100644 --- a/py/power_prompt_simple.py +++ b/py/power_prompt_simple.py @@ -11,11 +11,10 @@ class RgthreePowerPromptSimple(RgthreePowerPrompt): @classmethod def INPUT_TYPES(cls): # pylint: disable = invalid-name, missing-function-docstring - SAVED_PROMPTS_FILES=folder_paths.get_filename_list('saved_prompts') + # Removed Saved Prompts feature; No sure it worked any longer. UI should fail gracefully, + # TODO: Rip out saved prompt input data + SAVED_PROMPTS_FILES=[] SAVED_PROMPTS_CONTENT=[] - for filename in SAVED_PROMPTS_FILES: - with open(folder_paths.get_full_path('saved_prompts', filename), 'r') as f: - SAVED_PROMPTS_CONTENT.append(f.read()) return { 'required': { 'prompt': ('STRING', {'multiline': True}), diff --git a/py/sdxl_power_prompt_postive.py b/py/sdxl_power_prompt_postive.py index 5f27e53..25bc1f0 100644 --- a/py/sdxl_power_prompt_postive.py +++ b/py/sdxl_power_prompt_postive.py @@ -20,11 +20,10 @@ class RgthreeSDXLPowerPromptPositive: @classmethod def INPUT_TYPES(cls): # pylint: disable = invalid-name, missing-function-docstring - SAVED_PROMPTS_FILES = folder_paths.get_filename_list('saved_prompts') - SAVED_PROMPTS_CONTENT = [] - for filename in SAVED_PROMPTS_FILES: - with open(folder_paths.get_full_path('saved_prompts', filename), 'r') as f: - SAVED_PROMPTS_CONTENT.append(f.read()) + # Removed Saved Prompts feature; No sure it worked any longer. UI should fail gracefully, + # TODO: Rip out saved prompt input data + SAVED_PROMPTS_FILES=[] + SAVED_PROMPTS_CONTENT=[] return { 'required': { 'prompt_g': ('STRING', {