From bcdd92cd0f23cfef862493bf5b5d9e695145f7db Mon Sep 17 00:00:00 2001 From: bash-j Date: Wed, 9 Aug 2023 20:10:08 +0930 Subject: [PATCH] modified: README.md modified: mikey_nodes.py --- README.md | 4 +++- mikey_nodes.py | 8 ++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index f84888f..5c2241c 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ This repository contains custom nodes for ComfyUI. -## Prompt With Style V3 +## Prompt With Style ![image](https://github.com/bash-j/mikey_nodes/assets/3195567/b39f6693-d0c4-479d-9c8f-530dfb67e7e4) @@ -13,6 +13,8 @@ You can add styles by using the `` syntax. Some of the styles built in are: `SAI-Enhance, SAI-Anime, SAI-Photographic, SAI-Digital art, SAI-Comic book, SAI-Fantasy art, SAI-Analog film, SAI-Neonpunk, SAI-Isometric, SAI-Lowpoly, SAI-Origami, SAI-Line art, SAI-Craft clay, SAI-Cinematic, SAI-3d-model, SAI-pixel art, SAI-Texture, photographic, deep-field, analog-film, cinematic, red, documentary, nature-photography, editorial, polaroid, 3d-model, low-poly, modeling-compound, diorama, miniatures, abstract, anime, comic-book, digital-art, fantasy-art, dark-fantasy, oil-painting, watercolor, charcoal, color-pencil, crayon, cross-stitch, felt, origami, scrapbook, isometric, line-art, vector-art, neon-punk, pixel-art, tile-texture, lithography, mosaic, woodblock-print, sticker, stained-glass, tattoo, statue, album-art, wes-anderson, vaporwave, clarendon, gingham, juno, lark, nonagon, kaleidoscope, haunting, glam, mecha, padam, collage, paper-mache, macrame, quilling, pottery, batik, felting, marquetry, wildstyle-graffiti, bubble-graffiti, stencil-graffiti, throw-up-graffiti, tag-graffiti` +### Wildcards + Wildcards are supported using the `__word__` syntax. Folder location is comfyui/wildcards You can select more than 1 line from the wildcard by using the syntax `[2$$__wildcard__]` for 2 lines in this example. You can also add a word to search for in the wildcard file e.g. `__wildcard|word__` There are outputs for image size and prompts for the clip conditioners. diff --git a/mikey_nodes.py b/mikey_nodes.py index 8c993b0..cf15c82 100644 --- a/mikey_nodes.py +++ b/mikey_nodes.py @@ -587,17 +587,17 @@ class SaveImagesMikey: metadata = PngInfo() pos_trunc = '' if prompt is not None: - metadata.add_text("prompt", json.dumps(prompt)) + metadata.add_text("prompt", json.dumps(prompt, ensure_ascii=False)) if extra_pnginfo is not None: for x in extra_pnginfo: - metadata.add_text(x, json.dumps(extra_pnginfo[x])) + metadata.add_text(x, json.dumps(extra_pnginfo[x], ensure_ascii=False)) if positive_prompt: - metadata.add_text("positive_prompt", json.dumps(positive_prompt)) + metadata.add_text("positive_prompt", json.dumps(positive_prompt, ensure_ascii=False)) # replace any special characters with nothing and spaces with _ clean_pos = re.sub(r'[^a-zA-Z0-9 ]', '', positive_prompt) pos_trunc = clean_pos.replace(' ', '_')[0:80] if negative_prompt: - metadata.add_text("negative_prompt", json.dumps(negative_prompt)) + metadata.add_text("negative_prompt", json.dumps(negative_prompt, ensure_ascii=False)) ts_str = datetime.datetime.now().strftime("%y%m%d%H%M%S") file = f"{ts_str}_{pos_trunc}_{filename}_{counter:05}_.png" img.save(os.path.join(full_output_folder, file), pnginfo=metadata, compress_level=4)