Merge branch 'release/v0.0.2'

This commit is contained in:
Aaron C. de Bruyn
2024-01-19 21:34:16 -08:00
3 changed files with 8 additions and 3 deletions
+6
View File
@@ -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
==================
+1 -1
View File
@@ -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
============
+1 -2
View File
@@ -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():