diff options
author | Aarni Koskela <akx@iki.fi> | 2023-06-02 11:58:10 +0000 |
---|---|---|
committer | Aarni Koskela <akx@iki.fi> | 2023-06-02 12:07:10 +0000 |
commit | 51864790fd72386fbbbb015d24a43ce501ecaa4b (patch) | |
tree | a114dc065c25ec267043f35dea735f8e3097e9a0 /scripts | |
parent | 3e995778fc525ff15d56c1472c1a1bc701019ec5 (diff) | |
download | stable-diffusion-webui-gfx803-51864790fd72386fbbbb015d24a43ce501ecaa4b.tar.gz stable-diffusion-webui-gfx803-51864790fd72386fbbbb015d24a43ce501ecaa4b.tar.bz2 stable-diffusion-webui-gfx803-51864790fd72386fbbbb015d24a43ce501ecaa4b.zip |
Simplify a bunch of `len(x) > 0`/`len(x) == 0` style expressions
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/prompts_from_file.py | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/scripts/prompts_from_file.py b/scripts/prompts_from_file.py index 83a2f220..50320d55 100644 --- a/scripts/prompts_from_file.py +++ b/scripts/prompts_from_file.py @@ -121,8 +121,7 @@ class Script(scripts.Script): return [checkbox_iterate, checkbox_iterate_batch, prompt_txt]
def run(self, p, checkbox_iterate, checkbox_iterate_batch, prompt_txt: str):
- lines = [x.strip() for x in prompt_txt.splitlines()]
- lines = [x for x in lines if len(x) > 0]
+ lines = [x for x in (x.strip() for x in prompt_txt.splitlines()) if x]
p.do_not_save_grid = True
|