From 8769bbcb70413dfdaa08d91d147a76dc99dcbde8 Mon Sep 17 00:00:00 2001 From: "Aaron C. de Bruyn" Date: Fri, 19 Jan 2024 21:33:41 -0800 Subject: [PATCH 1/3] Forgot to mention the feature that made me write DarkPrompt --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7d3758c..bbec60d 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ DarkPrompt ========== DarkPrompt reads lines from a file and/or a text input, combines them together, optionally strips out comments and blank lines, and then selects a random line for use in generating your prompt based on a seed input. It also has a "prefix" and "suffix" field so you can easily include additional information with each prompt or wrap it inside a weight. For example a prefix of '(' and a suffix of ':1.2)' could return a string: ```(walking a dog:1.2)``` from an file named ```activities.txt``` that contains a line ```walking a dog```. -Unlike several other ComfyUI projects, the box is somewhat more compact and gives you an easy way to combine file and text sources for prompt generation. +Unlike several other ComfyUI projects, the box is somewhat more compact, gives you an easy way to combine file and text sources for prompt generation, and most importantly it re-reads the files after every prompt generation so you don't have to restart ComfyUI after editing wildcard files. DarkCombiner ============ From 3429be7ab7d8e7604d850a3b2973542d6d368d14 Mon Sep 17 00:00:00 2001 From: "Aaron C. de Bruyn" Date: Fri, 19 Jan 2024 21:33:55 -0800 Subject: [PATCH 2/3] Raise an error if a file is not found --- __init__.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/__init__.py b/__init__.py index 260c6f1..6abaed8 100644 --- a/__init__.py +++ b/__init__.py @@ -154,7 +154,6 @@ class DarkPrompt(object): raise ValueError("DarkPrompt text and filename can not both be blank") if filename: - print("Trying to read %s" % (filename)) try: f = open(filename, "r") file_lines = f.read().splitlines() @@ -162,7 +161,7 @@ class DarkPrompt(object): lines.append(line) print("Successfully read %s" % (filename)) except FileNotFoundError: - logger.error("File not found: %s" % (filename)) + raise FileNotFoundError("DarkPrompt unable to load: %s" % (filename)) if text: for text_line in text.splitlines(): From 1498fbdde9f0f98b7d3c0c440c226eef2f381ef3 Mon Sep 17 00:00:00 2001 From: "Aaron C. de Bruyn" Date: Fri, 19 Jan 2024 21:34:13 -0800 Subject: [PATCH 3/3] Update changelog for release --- History.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/History.md b/History.md index 3c1b3a3..8978c8f 100644 --- a/History.md +++ b/History.md @@ -1,4 +1,10 @@ +v0.0.2 / 2024-01-19 +================== + + * Raise an error if a file is not found + * Forgot to mention the feature that made me write DarkPrompt + v0.0.1 / 2024-01-19 ==================