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 ================== 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 ============ 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():