diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..b30ca0e --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,21 @@ +name: Publish to Comfy registry +on: + workflow_dispatch: + push: + branches: + - main + paths: + - "pyproject.toml" + +jobs: + publish-node: + name: Publish Custom Node to registry + runs-on: ubuntu-latest + steps: + - name: Check out code + uses: actions/checkout@v4 + - name: Publish Custom Node + uses: Comfy-Org/publish-node-action@main + with: + ## Add your own personal access token to your Github Repository secrets and reference it here. + personal_access_token: ${{ secrets.REGISTRY_ACCESS_TOKEN }} diff --git a/.gitignore b/.gitignore index 15201ac..2198c74 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,8 @@ +txtfiles/humans.txt +txtfiles/others.txt +txtfiles/human_poses.txt +txtfiles/styles.txt + # Byte-compiled / optimized / DLL files __pycache__/ *.py[cod] diff --git a/README.md b/README.md index c08cae5..342b2b2 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,107 @@ -# ComfyUI_OneButtonPrompt_Flux - One Button Prompt for Flux in ComfyUI +![One Button Prompt for Flux in ComfyUI](https://github.com/billwuhao/ComfyUI_OneButtonPrompt_Flux/blob/main/images/example.png) + +--- + +# One Button Prompt for Flux in ComfyUI + +## Summary + +This is a node for generating Flux prompts with one click in ComfyUI. + +## Usage + +- **If "human" is selected**, it will generate only the human-related prompt. +- **If "other" is selected**, it will generate only the other-related prompt. +- **If "dual_subject" is selected**, it will include both of the above. +- **If "human_pose" is enabled**, it will generate a human pose prompt. +- **If "style" is enabled**, it will generate a style prompt. +- **Lora trigger words/prefixes** are optional and can be customized. +- If you have modified the custom file during the generation images, please enable **refresh** to update it, without having to restart the software +- **If the seed is fixed**, it will generate the same fixed prompt. + +![alt text](https://github.com/billwuhao/ComfyUI_OneButtonPrompt_Flux/blob/main/images/image-1.png) + +**Example Prompt**: + +(MW:1.2), a beautiful girl, fall asleep, A beautiful lovely alpaca, naive art + +- `(MW:1.2)` is the **Lora trigger word**. +- `a beautiful girl` is the **human**. +- `fall asleep` is the **human_pose**. +- `A beautiful lovely alpaca` is the **other**. +- `naive art` is the **style**. + +## Custom Subjects, Poses, and Styles + +1. Create four files under the folder `ComfyUI\custom_nodes\ComfyUI_OneButtonPrompt_Flux\txtfiles`. + + ![alt text](https://github.com/billwuhao/ComfyUI_OneButtonPrompt_Flux/blob/main/images/image.png) + +2. Input the corresponding content into each file to generate your custom subject, pose, and style. + +3. The `prompt_words.xlsx` file contains prompts I gathered a long time ago when experimenting with **Disco Diffusion** and **SD 1.5**. You can refer to it for ideas. + +**Note**: Be sure to create new files and modify them freely; this will not affect the node's functionality or future updates. + +## Automatic Image Generation + +If you want to automatically generate images while your computer is running, select `Queue (On Change)` and click Start. Workflow in `workflow_example`. + +![alt text](https://github.com/billwuhao/ComfyUI_OneButtonPrompt_Flux/blob/main/images/image-2.png) + +## Using with Prompt Enhancer + +ComfyUI-Fluxpromptenhancer: https://github.com/marduk191/ComfyUI-Fluxpromptenhancer + +--- + +## 概述 + +这是一个在 comfyui 中一键生成 flux 提示的节点. + +## 用法 + +- 主体选择 human,则只生成 human 提示 +- 选择 other,则只生成 other 提示 +- 选择 dual_subject,则包含上述两者 +- 如果开启 human_pose,将生成人物姿态提示 +- 如果开启 style,将生成 style 提示 +- lora 触发词/前缀 是可选的,可自定义输入 +- 如果你在运行过程中修改了自定义文件, 请开启 refresh 刷新一下, 而不用重启软件. +- 如果固定种子,将只生成一次固定的提示 + +![alt text](https://github.com/billwuhao/ComfyUI_OneButtonPrompt_Flux/blob/main/images/image-1.png) + +(MW:1.2), a beautiful girl, fall asleep, A beautiful lovely alpaca, naive art + +- `(MW:1.2)`, 是 lora 触发词 +- `a beautiful girl`, 是 human +- `fall asleep`, 是 human_pose +- `A beautiful lovely alpaca`, 是 other +- `naive art`, 是 style + +## 自定义主体,姿态和风格 + +1. 在文件夹 `ComfyUI\custom_nodes\ComfyUI_OneButtonPrompt_Flux\txtfiles` 下面新建 4 个文件 + + ![alt text](https://github.com/billwuhao/ComfyUI_OneButtonPrompt_Flux/blob/main/images/image.png) + +2. 分别输入相应的内容, 即可生成自定义的主体, 姿态, 风格 + +3. `prompt_words.xlsx` 文件里是我很早的时候, 玩 disco diffusion 和 sd1.5 时整理的提示, 你可以参考. + +注意: 一定要新建文件, 然后随意修改, 并不会影响节点使用和更新. + +## 自动生图 + +如果你想挂着电脑自动生图, 选择 `Queue (On Change)` 点击开始即可. 工作流在 `workflow_example` 里. + +![alt text](https://github.com/billwuhao/ComfyUI_OneButtonPrompt_Flux/blob/main/images/image-2.png) + +## 结合 Prompt Enhancer 一起使用 + +ComfyUI-Fluxpromptenhancer: https://github.com/marduk191/ComfyUI-Fluxpromptenhancer + +# Thank you + +Thank you to the amazing [OneButtonPrompt](https://github.com/AIrjen/OneButtonPrompt) for inspiration. \ No newline at end of file diff --git a/__init__.py b/__init__.py new file mode 100644 index 0000000..6d07833 --- /dev/null +++ b/__init__.py @@ -0,0 +1,113 @@ +import random +import os + +def process_txt_file(txtfile: str): + script_dir = os.path.dirname(os.path.abspath(__file__)) # Script directory + file_path = os.path.join(script_dir, "./txtfiles/", txtfile) + + if not os.path.exists(file_path): + file_path = os.path.join(script_dir, "./txtfiles/", "example_" + txtfile) + + with open(file_path, 'r', encoding='utf-8') as file: + lines = file.readlines() + + processed_lines = [line.strip() for line in lines if line.strip()] + return processed_lines + +humans = process_txt_file("humans.txt") +others = process_txt_file("others.txt") +human_poses = process_txt_file("human_poses.txt") +styles = process_txt_file("styles.txt") +subject = ["human", "other", "dual_subject"] + +def generate_prompt(subject: str, human_pose: bool, style: bool, lora_trigger_or_prefix: str, refresh: bool, seed: int): + + if refresh: + global humans, others, human_poses, styles + + humans = process_txt_file("humans.txt") + others = process_txt_file("others.txt") + human_poses = process_txt_file("human_poses.txt") + styles = process_txt_file("styles.txt") + + if seed > 0: + random.seed(seed) + + prompt_human = random.choice(humans) + prompt_other = random.choice(others) + prompt_human_pose = random.choice(human_poses) + prompt_style = random.choice(styles) + + if subject == "human": + prompt_subject = random.choice(humans) + if human_pose == True: + prompt_subject = prompt_subject + ", " + prompt_human_pose + + if subject == "other": + prompt_subject = prompt_other + + if subject == "dual_subject": + if human_pose == True: + prompt_subject = prompt_human + ", " + prompt_human_pose + ", " + prompt_other + else: + prompt_subject = prompt_human + ", " + prompt_other + + if lora_trigger_or_prefix: + if lora_trigger_or_prefix.strip(): + lora_trigger_or_prefix = lora_trigger_or_prefix.strip() + ", " + + if style == True: + prompt = lora_trigger_or_prefix + prompt_subject + ", " + prompt_style + else: + prompt = lora_trigger_or_prefix + prompt_subject + + return prompt + +class OneButtonPromptFlux: + + CATEGORY = "MW-OneButtonPrompt" + RETURN_TYPES = ("STRING",) + RETURN_NAMES = ("prompt",) + FUNCTION = "fluxprompt" + + @classmethod + def INPUT_TYPES(s): + + return { + "required": { + "subject": (subject, { + "default": "human", "tooltip": "'dual_subject' including both" + }), + }, + "optional": { + "human_pose": ("BOOLEAN", {"default": False, "tooltip": "Effective when selecting 'human'"}), + "style": ("BOOLEAN", {"default": True}), + "lora_trigger_or_prefix": ("STRING", { + "multiline": False, + "default": "", "tooltip": "Lora trigger words or custom prefix." + }), + "refresh": ("BOOLEAN", {"default": False}), + "seed": ("INT", {"default": 0, "min": 0, "max": 0xFFFFFFFFFFFFFFFF}), + }, + } + + def fluxprompt( + self, + subject: str = "human", + human_pose: bool = False, + style: bool = True, + lora_trigger_or_prefix: str = "", + refresh: bool = False, + seed: int = 0): + + return (generate_prompt(subject, human_pose, style, lora_trigger_or_prefix, refresh, seed),) + + +NODE_CLASS_MAPPINGS = { + "OneButtonPromptFlux": OneButtonPromptFlux, + +} + +NODE_DISPLAY_NAME_MAPPINGS = { + "OneButtonPromptFlux": "One Button Prompt Flux", +} \ No newline at end of file diff --git a/images/example.png b/images/example.png new file mode 100644 index 0000000..4ff070a Binary files /dev/null and b/images/example.png differ diff --git a/images/image-1.png b/images/image-1.png new file mode 100644 index 0000000..8e31005 Binary files /dev/null and b/images/image-1.png differ diff --git a/images/image-2.png b/images/image-2.png new file mode 100644 index 0000000..cb1c4c4 Binary files /dev/null and b/images/image-2.png differ diff --git a/images/image.png b/images/image.png new file mode 100644 index 0000000..0bc4cb5 Binary files /dev/null and b/images/image.png differ diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..b9fede4 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,14 @@ +[project] +name = "ComfyUI_OneButtonPrompt_Flux" +description = "ComfyUI_OneButtonPrompt_Flux is a Flux prompt generation node. The subject can be "human," "other" or a combination of both. For human, pose settings can be enabled. Additionally, various styles can be applied. Finally, combine it with "Prompt Enhancement" to seamlessly automate image generation, eliminating the hassle of designing prompts." +version = "1.0.0" +license = { file = "LICENSE" } + +[project.urls] +Repository = "https://github.com/billwuhao/ComfyUI_OneButtonPrompt_Flux" +# Used by Comfy Registry https://comfyregistry.org + +[tool.comfy] +PublisherId = "MW" +DisplayName = "ComfyUI_OneButtonPrompt_Flux" +Icon = "" \ No newline at end of file diff --git a/txtfiles/example_human_poses.txt b/txtfiles/example_human_poses.txt new file mode 100644 index 0000000..68d5dce --- /dev/null +++ b/txtfiles/example_human_poses.txt @@ -0,0 +1,63 @@ +on horseback +read a book +fall asleep +lie in bed +Holding a samurai sword +Holding the Swordsman Sword +have a meal +Make a heart-shaped gesture +Make a V gesture +military salute +run +cry +Giving a thumbs up +Flipping the middle finger +Posing like a cat +Aiming with a finger gun +Putting a finger to lips, shushing +Holding something in hands +Waving hand +Saluting with a raised hand +Stretching arms upwards +Raising both arms in the air +Spreading arms wide +Hand placed on mouth +Pulling hair +Showing armpits +Performing a curtsy +Smiling with fingers +Resting chin on hand +Supporting body with arm +Keeping arms behind back +Crossing arms in front of body +Placing hand on hip +Hands resting on hips +Adjusting thigh-high stockings +Dancing the "Caramelldansen" +Holding hands with someone +Crossing legs while sitting +Lying in a fetal position +Lifting one leg +Lying on back with legs up +Spreading legs apart +Carrying someone like a princess +Taking a fighting stance +Upside-down, head down +Looking back over shoulder +Lying on stomach +Squatting down +Straddling +Kneeling on both knees +Bending over +On all fours (hands and knees) +Arched back while standing +Sitting upright +Sitting in seiza (Japanese kneeling position) +Sitting in wariza (legs splayed to the sides) +Sitting sideways with legs to one side +Sitting in Indian style (cross-legged) +Hugging one's own legs +Leaning forward +Hugging someone +Lying on lap (lap pillow position) +Standing with relaxed posture \ No newline at end of file diff --git a/txtfiles/example_humans.txt b/txtfiles/example_humans.txt new file mode 100644 index 0000000..9e3011d --- /dev/null +++ b/txtfiles/example_humans.txt @@ -0,0 +1,65 @@ +A handsome soldier in uniform +A stern policeman on duty +A fatherly man with a gentle smile +A beautiful, ethereal fairy +A mystical mermaid with flowing hair +A beautiful woman in police uniform +A metallic, robotic girl with glowing features +A caring, motherly girl +A strong, masculine man +A chivalrous man offering a helping hand +A dapper, well-dressed man +A handsome man with a confident posture +A muscular, macho man +A regal royal woman in elegant attire +A stunning beach woman in a bikini +A beautiful Chinese classical woman in traditional dress +A graceful Imperial Concubine in royal attire +A beautiful Khātam girl with traditional features +A brave grenadier in military uniform +A quintessential technocrat with a serious demeanor +A short, dwarfish warrior in armor +An elfin girl with pointed ears and mystical aura +A cybernetic female robot with futuristic design +A regal emperor in royal portrait style +A queen in a majestic gown +A skilled swordsman with a sharp blade +A fierce warrior ready for battle +A beautiful angel with delicate wings +A wise, white Gandalf-like wizard +A beautiful girl in a flowing Hanfu dress +A silhouette of a woman at dusk +A man with a cat's head, exotic and mysterious +A male adult film star with confident charm +A strong, penetrating man with intense eyes +A perky, energetic man with a broad smile +A tough guy with a rugged look +A scruffy man with a disheveled appearance +A teenage boy, handsome and fresh-faced +A young virgin with innocent eyes +A muscular, handsome man with defined features +A stylish male model striking a pose +A beautiful woman with a cat's head, mystical charm +A beautiful actress with a captivating smile +A graceful female model in fashion pose +A beautiful, sensual nurse in a healing pose +A seductive female student with a curious expression +A beautiful Medusa with mesmerizing eyes +A playful, frisky girl with a mischievous smile +A wise Elven king with a crown of leaves +A beautiful, youthful loli with innocence +A beautiful traditional woman in classic attire +A beautiful oriental woman with exotic features +A powerful magic patriarch with ancient wisdom +A demon world chief with fiery eyes +A mighty orc chief with fierce strength +A spectral figure in ghostly attire +A zombie rising from the grave +A skeletal figure with hollow eyes +A dragonborn warlock with mystical powers +A cyberpunk ape with high-tech enhancements +A vampire with sharp fangs and glowing eyes +A wizard casting a spell in the dark +A devil with fiery horns and red skin +A fierce female orc with battle scars +A death god with a dark aura \ No newline at end of file diff --git a/txtfiles/example_others.txt b/txtfiles/example_others.txt new file mode 100644 index 0000000..4cbbfa8 --- /dev/null +++ b/txtfiles/example_others.txt @@ -0,0 +1,154 @@ +Cthulhu +Convertible +Coupe +Dragster +Hatchback +Hearse +Hotrod +Humvee +Jeep +Van +Motorcycle +Tank +Hedgehog +Hippopotamus +Fierce Leopard +Elephant +Affenpinscher +Beautiful Crane +Heron +Arctic Fox +Fennec Fox +Fire Wolf +Chibi Dragon +Dragon +Deer with beautiful horns +Deer +Camel +Majestic Horse +Herd of Horses +Zebra +Mighty Bull Demon King +Mighty Bull with long horns +Beautiful Antarctic Cyber Penguin +Mighty Lion +Fierce Lion close-up +Fierce Bear +Beautiful and Lovely Bear +Charming Panda +Beautiful Swan +Cyber Swan +Long-Horned Ram +Lovely Alpaca +Parrotlet +Spix's Macaw +Bearded Vulture +Cinereous Vulture +Marble Caves in Chile +Benagil Sea Cave, Portugal +Reed Flute Cave, China +Crystal Caves, Iceland +Frasassi Caves, Italy +Antarctica Landscape +Avenue of the Baobabs +Most Beautiful Bay in the World +Most Beautiful Bayou +Mount Ararat +Mount Blanc +Mount Everest +Mount Fuji +Mount Kenya +Seascape +Serengeti National Park +Sloping Meadows +The Dark Hedges +Grand Canyon +Lofoten Islands +Torres del Paine National Park +Victoria Falls +Wadi Rum +Beautiful Waterfalls +Waterside City +Wetland Landscape +Wulingyuan Scenic Area +Yulong Xueshan +Ship and Huge Storm on the Sea +Cactus Kingdom +Mountainous Landscape +Giant Ships and Storms +Beautiful Ornate Landscape +Placid Lakescape +Precipitous Waterfalls +Heavenly Capital +Precipitous Cliff with River +Precipitous Cliff and Colossal Statues +Magic Dense Primordial Forest +Regal Ancient Palace in Heaven +Regal Ancient Palace in Clouds +Rustic Floral House in Clouds +Spooky Secluded Magic Landscape +Spectacular Dreamlike Ships in Space +Staggering Wonder Landscape +Sublime Beauty of Nature +Supernatural Landscape at Night +Aliens Invading Fantasy Landscape +Reclusive Fantasy Landscape +Angkor Wat +Burj Khalifa +Colosseum +Eiffel Tower +Empire State Building +Hagia Sophia +La Sagrada Familia +Lotus Temple +Namcha Barwa Architecture +Notre Dame Cathedral +Parliament Building +Parthenon +Pavilion +Petra Historical City +Saint Basil’s Cathedral +Sydney Opera House +Taj Mahal +Heydar Aliyev Center +Palace of Westminster +Dreamlike Seaside Tower at Moonlight +Domed Building +Pagoda +Portal to Heaven +Art Deco City +Infinite Hallway +Shining Hotel Lobby +Scientific Base +Giant Skyscraper +Predjama Castle, Slovenia +Majlis al Jinn, Oman +Ajanta Caves, India +Legislative Edifice +Magnificent Building +Narrow Corridor to Hell +Narrow Corridor to Heaven +Opulent Apartment +Opulent Detached Houses +Opulent Throne Room +Palatial Chamber +Palatial Office Building +Palatial House with Lights at Night +Quintessential Symbol of a City +Spooky Sacrificial Building +Soaring Magic Building in Cloud +Soaring Building +Spiraled Science Fiction Building +Magic Subterranean Research Station +Towering Ancient Temples in Rosy Clouds +Towering Sci-Fi Space Station in Universe +Beautiful Modern Architecture in Clouds +Beautiful Ancient Architecture in China at Dusk +Cyberpunk Bustling Downtown +Intricate Deconstructivism Architecture +Fractalism Building +Beautiful Architectural Painting +Art Deco Palace Lobby +Art Nouveau Gorgeous Architecture Interior +Baroque Gorgeous Architecture Interior +Martial Arts Silhouette at Dusk diff --git a/txtfiles/example_styles.txt b/txtfiles/example_styles.txt new file mode 100644 index 0000000..72015e4 --- /dev/null +++ b/txtfiles/example_styles.txt @@ -0,0 +1,240 @@ +Digital 3D Sculpting +Diorama +Mythpunk +Kinetic Art +Junk Art +3D Game Shader +3D Ambient Occlusion +3D Pre-rendered Graphics +Voxel Art +Arte Povera +Carved Lacquer Art +Wood Intarsia Art +Steel Engraving +Wood Engraving +Carving Art +Relief Art +Digital Art +Vector Art +Acrylic Painting +Charcoal Drawing +Colored Pencil Drawing +Encaustic Painting +Fresco Painting +Gouache +Ink Wash Painting +Matte Painting +Oil Painting +Pastel Drawing +Pencil Drawing +Silverpoint Drawing +Tempera Painting +Velvet Painting +Watercolor Painting +Marouflage Painting +Mural Art +Stippling +Hudson River School Painting +Naturalism Painting +Allegorical +Romanticism +Ashcan School +Barbizon School Painting +Chalk Drawing +Chinese Painting +Crayon Drawing +Dutch Golden Age +French Renaissance +German Renaissance +High Renaissance +Impressionism +Ink Drawing +Mannerism +Neo-Impressionism +Orientalism +Panel Painting +Pointillism +Post-Impressionism +Pre-Raphaelites +Realism Painting +Social Realism Painting +Still Life +Synthetism +Tonalism +Mixed Media Painting +Amsterdam Impressionism +Landscape Painting +Fantastic Realism +Magic Realism +Flemish Baroque +Rococo +Figurative Art +Neoclassicism Art +Nihonga Painting +Fantasy Art +Adventure Pulp Poster +Flat Color Picture +Graphic Novel +Propaganda Poster +Storybook Illustration +Comic Strip +Caravaggisti +Edo Period Painting +Hyperrealism Art +Photorealism +Anime +Manga +Infrared Art +Mexican Muralism +HD Photo +National Geographic Photo +Stage Photo +Film Still +Autochrome +French New Wave +Redscale +Pixel Art +Needlepoint Art +Mosaic Art +Stained Glass Art +Cross-Stitch Art +Embroidery Art +Intarsia Art +Fiber Art +Indienne Textile Art +Tapestry Art +Chinoiserie Art +Naive Art +X-ray Photography +Line Art +Isometric Art +Low Poly +Art Brut +Chillwave Art +Graffiti Art +Maximalism +Phantasm Art +Illusionism Art +Aestheticism Art +Avant-Garde Art +Fractalism +LSD Art +Psychedelic Punk +Chinese Paper Cutting +Kirie Paper Art +Massurrealism +Surrealism +Botanical Illustration +Marine Art +Spray Paint Art +Primitivism Painting +Icon Religious Painting +Master Print Art +Flower Bouquet Art +Sōsaku-Hanga +Clockpunk +Dieselpunk +Mechanical Punk +Steampunk +Steelpunk +Baroque +Brutalism Art +Modernism Art +Romanesque +Trompe-l'œil Painting +Afrofuturism +Cyberpunk +Futuresynth Art +Post-Cyberpunk +Sci-Fi +Solarpunk +Tech Noir +Synthwave Art +Cartoon +Chibi +Children’s Illustration +Lowbrow Art +Fractal Manifold +Solarised Art +Spatialism Art +Vaporwave +Computer-Generated Hologram +Caricature +Character Design +Peking Opera Art +Pin-Up +Pop Art +Thangka Art +Fauvism +Gothic +Collage +Silhouette +Geometric Art +Illuminated Manuscript +Indian Ink Painting +Minimalism +Op Art +Screenprint Art +Anaglyph Effect Art +Japonisme Art +Arabesque Patterns Art +Acidwave Art +Cyberart +Optical Illusion Art +Y2K Aesthetic Art +Manichaean Art +Shin-Hanga Painting +Ukiyo-e Painting +2D Game +Retrowave Art +Aquatint Art +Etching Art +Linocut Art +Woodblock +Popular Print Art +Lithography Painting +Engraving +Concept Art +Dark Academia Art +Fashion Art +Feminist Art +Melanin Art +Movie Poster +Nirvana Art +Street Art +Thunderpunk +Kawaii +Pop Surrealism +Cybernetic Art +Daydream Punk Art +Acidpunk Art +Aetherpunk Art +Funk Art +Decopunk Art +Kitsch +Art Nouveau +Art Deco +Arts and Crafts Movement +Eastern Art +Electronic Art +Modern Anime Still +DMT Art +Line-Drawing +Ambient Occlusion Art +Cel Shading Art +Double Exposure +Intricate Pattern Details Art +Leave Negative Space +3D Printed Art +Sculpture Art +Statue Art +By Famous Artists (e.g., Alex Grey, Albert Bierstadt) +Expressionism +Figurativism +German Expressionism +Glitch Art +Cyanotype +Futurism +Abstract +Cubism +De Stijl \ No newline at end of file diff --git a/txtfiles/prompt_words.xlsx b/txtfiles/prompt_words.xlsx new file mode 100644 index 0000000..bae528f Binary files /dev/null and b/txtfiles/prompt_words.xlsx differ diff --git a/workflow_example/FLUX automatic prompt generates images automatically.json b/workflow_example/FLUX automatic prompt generates images automatically.json new file mode 100644 index 0000000..bfe8f8e --- /dev/null +++ b/workflow_example/FLUX automatic prompt generates images automatically.json @@ -0,0 +1 @@ +{"last_node_id":38,"last_link_id":50,"nodes":[{"id":26,"type":"UNETLoader","pos":[601.9408569335938,-59.138397216796875],"size":[315,82],"flags":{},"order":0,"mode":0,"inputs":[],"outputs":[{"name":"MODEL","type":"MODEL","links":[26],"slot_index":0,"label":"模型"}],"properties":{"Node name for S&R":"UNETLoader"},"widgets_values":["flux1-dev-fp8-e4m3fn.safetensors","fp8_e4m3fn"]},{"id":30,"type":"DualCLIPLoader","pos":[614.5003051757812,73.95501708984375],"size":[315,106],"flags":{},"order":1,"mode":0,"inputs":[],"outputs":[{"name":"CLIP","type":"CLIP","links":[45]}],"properties":{"Node name for S&R":"DualCLIPLoader"},"widgets_values":["clip_l.safetensors","t5xxl_fp8_e4m3fn_scaled.safetensors","flux","default"]},{"id":28,"type":"VAELoader","pos":[610.175537109375,231.96678161621094],"size":[315,58],"flags":{},"order":2,"mode":0,"inputs":[],"outputs":[{"name":"VAE","type":"VAE","links":[28],"slot_index":0}],"properties":{"Node name for S&R":"VAELoader"},"widgets_values":["flux-vae.safetensors"]},{"id":38,"type":"ConditioningZeroOut","pos":[1348.318115234375,199.7115936279297],"size":[317.4000244140625,26],"flags":{},"order":11,"mode":0,"inputs":[{"name":"conditioning","type":"CONDITIONING","link":44}],"outputs":[{"name":"CONDITIONING","type":"CONDITIONING","links":[47],"slot_index":0}],"properties":{"Node name for S&R":"ConditioningZeroOut"}},{"id":37,"type":"FluxGuidance","pos":[1347.64794921875,298.15301513671875],"size":[317.4000244140625,58],"flags":{},"order":10,"mode":0,"inputs":[{"name":"conditioning","type":"CONDITIONING","link":43}],"outputs":[{"name":"CONDITIONING","type":"CONDITIONING","links":[46],"slot_index":0}],"properties":{"Node name for S&R":"FluxGuidance"},"widgets_values":[3.5]},{"id":36,"type":"CLIPTextEncode","pos":[1350.284912109375,-41.22111129760742],"size":[292.2908020019531,69.72785186767578],"flags":{"collapsed":false},"order":9,"mode":0,"inputs":[{"name":"clip","type":"CLIP","link":45,"label":"CLIP"},{"name":"text","type":"STRING","link":50,"widget":{"name":"text"}}],"outputs":[{"name":"CONDITIONING","type":"CONDITIONING","links":[43,44],"slot_index":0,"label":"条件"}],"properties":{"Node name for S&R":"CLIPTextEncode"},"widgets_values":[""],"color":"#232","bgcolor":"#353"},{"id":15,"type":"easy showAnything","pos":[967.9528198242188,533.3350219726562],"size":[284.5148010253906,207.843505859375],"flags":{},"order":6,"mode":0,"inputs":[{"name":"anything","type":"*","link":11,"shape":7}],"outputs":[{"name":"output","type":"*","links":[42],"slot_index":0}],"properties":{"Node name for S&R":"easy showAnything"},"widgets_values":["A caring, motherly girl, Raising both arms in the air, Affenpinscher, Silverpoint Drawing"]},{"id":22,"type":"KSampler","pos":[1714.8028564453125,-57.177364349365234],"size":[315,474],"flags":{},"order":12,"mode":0,"inputs":[{"name":"model","type":"MODEL","link":29},{"name":"positive","type":"CONDITIONING","link":46},{"name":"negative","type":"CONDITIONING","link":47},{"name":"latent_image","type":"LATENT","link":22}],"outputs":[{"name":"LATENT","type":"LATENT","links":[23],"slot_index":0}],"properties":{"Node name for S&R":"KSampler"},"widgets_values":[496000910566919,"randomize",10,1,"euler","normal",1]},{"id":24,"type":"VAEDecode","pos":[2063.22900390625,-34.40923309326172],"size":[210,46],"flags":{},"order":13,"mode":0,"inputs":[{"name":"samples","type":"LATENT","link":23},{"name":"vae","type":"VAE","link":28}],"outputs":[{"name":"IMAGE","type":"IMAGE","links":[25,40],"slot_index":0}],"properties":{"Node name for S&R":"VAEDecode"},"widgets_values":[]},{"id":25,"type":"PreviewImage","pos":[2074.49072265625,269.2081298828125],"size":[452.7001647949219,475.4311828613281],"flags":{},"order":14,"mode":0,"inputs":[{"name":"images","type":"IMAGE","link":25}],"outputs":[],"properties":{"Node name for S&R":"PreviewImage"},"widgets_values":[]},{"id":35,"type":"SaveImage","pos":[2303.78955078125,-75.14215850830078],"size":[224.41139221191406,270],"flags":{},"order":15,"mode":0,"inputs":[{"name":"images","type":"IMAGE","link":40}],"outputs":[],"properties":{"Node name for S&R":"SaveImage"},"widgets_values":["ComfyUI"]},{"id":29,"type":"LoraLoaderModelOnly","pos":[954.8502807617188,-59.225555419921875],"size":[315,82],"flags":{},"order":5,"mode":0,"inputs":[{"name":"model","type":"MODEL","link":26}],"outputs":[{"name":"MODEL","type":"MODEL","links":[29],"slot_index":0}],"properties":{"Node name for S&R":"LoraLoaderModelOnly"},"widgets_values":["加速\\Hyper-FLUX.1-dev-8steps-lora_rank1.safetensors",0.2]},{"id":23,"type":"EmptyLatentImage","pos":[1336.218017578125,431.24981689453125],"size":[339.2215881347656,109.63313293457031],"flags":{},"order":3,"mode":0,"inputs":[],"outputs":[{"name":"LATENT","type":"LATENT","links":[22]}],"properties":{"Node name for S&R":"EmptyLatentImage"},"widgets_values":[1024,1024,1]},{"id":17,"type":"FluxPromptEnhance","pos":[973.8289794921875,331.8240661621094],"size":[283.6923522949219,126.52067565917969],"flags":{},"order":7,"mode":0,"inputs":[{"name":"prompt","type":"STRING","link":42,"widget":{"name":"prompt"}}],"outputs":[{"name":"STRING","type":"STRING","links":[13],"slot_index":0}],"properties":{"Node name for S&R":"FluxPromptEnhance"},"widgets_values":["",734164459401663,"randomize"]},{"id":18,"type":"easy showAnything","pos":[963.715576171875,76.98060607910156],"size":[294.3465576171875,194.2354736328125],"flags":{},"order":8,"mode":0,"inputs":[{"name":"anything","type":"*","link":13,"shape":7}],"outputs":[{"name":"output","type":"*","links":[50],"slot_index":0}],"properties":{"Node name for S&R":"easy showAnything"},"widgets_values":["A thoughtful young girl with a stern expression, her face a canvas of care and affection. A Silverpoint drawing, with a gentle, elegant color palette, adds a whimsical touch to the peaceful scene. Her hair, a cascade of pink and white, frames her face, while her hands are drawn to hold her, adding an intimate touch. The illustration is a thoughtful, enigmatic moment, focusing on her contemplative expression and the soft glow of her skin."]},{"id":14,"type":"OneButtonPromptFlux","pos":[598.8699340820312,373.7253723144531],"size":[315,202],"flags":{},"order":4,"mode":0,"inputs":[],"outputs":[{"name":"prompt","type":"STRING","links":[11],"slot_index":0}],"properties":{"Node name for S&R":"OneButtonPromptFlux"},"widgets_values":["dual_subject",true,true,"",false,90407625763492,"randomize"]}],"links":[[11,14,0,15,0,"*"],[13,17,0,18,0,"*"],[22,23,0,22,3,"LATENT"],[23,22,0,24,0,"LATENT"],[25,24,0,25,0,"IMAGE"],[26,26,0,29,0,"MODEL"],[28,28,0,24,1,"VAE"],[29,29,0,22,0,"MODEL"],[40,24,0,35,0,"IMAGE"],[42,15,0,17,0,"STRING"],[43,36,0,37,0,"CONDITIONING"],[44,36,0,38,0,"CONDITIONING"],[45,30,0,36,0,"CLIP"],[46,37,0,22,1,"CONDITIONING"],[47,38,0,22,2,"CONDITIONING"],[50,18,0,36,1,"STRING"]],"groups":[],"config":{},"extra":{"ds":{"scale":0.8769226950000013,"offset":[-344.83026640349493,214.92084137421307]},"node_versions":{"comfy-core":"v0.3.10-37-gd055325","ComfyUI_OneButtonPrompt_Flux":"53f4c29b5118753bdd4fcf5463b719196ed94b2c"},"ue_links":[],"groupNodes":{"FLUX CLIP":{"nodes":[{"id":-1,"type":"FluxGuidance","pos":[989.142333984375,439.9573669433594],"size":[317.4000244140625,58],"flags":{},"order":3,"mode":0,"inputs":[{"name":"conditioning","type":"CONDITIONING","link":null,"localized_name":"条件"}],"outputs":[{"name":"CONDITIONING","type":"CONDITIONING","links":[],"slot_index":0,"localized_name":"条件"}],"properties":{"Node name for S&R":"FluxGuidance"},"widgets_values":[3.5],"index":0},{"id":-1,"type":"ConditioningZeroOut","pos":[992.4752197265625,570.6519775390625],"size":[317.4000244140625,26],"flags":{},"order":2,"mode":0,"inputs":[{"name":"conditioning","type":"CONDITIONING","link":null,"localized_name":"条件"}],"outputs":[{"name":"CONDITIONING","type":"CONDITIONING","links":[],"slot_index":0,"localized_name":"条件"}],"properties":{"Node name for S&R":"ConditioningZeroOut"},"index":1},{"id":-1,"type":"CLIPTextEncode","pos":[532.1729736328125,445.6195068359375],"size":[422.84503173828125,164.31304931640625],"flags":{"collapsed":false},"order":1,"mode":0,"inputs":[{"name":"clip","type":"CLIP","link":null,"label":"CLIP","localized_name":"clip"}],"outputs":[{"name":"CONDITIONING","type":"CONDITIONING","links":[],"slot_index":0,"label":"条件","localized_name":"条件"}],"properties":{"Node name for S&R":"CLIPTextEncode"},"widgets_values":["a beautiful girl, zbrush, artstation,character sheet, in different poses and angles, including front view, side view, and back view, turnaround sheet"],"color":"#232","bgcolor":"#353","index":2}],"links":[[2,0,0,0,21,"CONDITIONING"],[2,0,1,0,21,"CONDITIONING"]],"external":[[{"id":-1,"type":"ConditioningZeroOut","pos":[992.4752197265625,570.6519775390625],"size":[317.4000244140625,26],"flags":{},"order":2,"mode":0,"inputs":[{"name":"conditioning","type":"CONDITIONING","link":null,"localized_name":"conditioning"}],"outputs":[{"name":"CONDITIONING","type":"CONDITIONING","links":[],"slot_index":0,"localized_name":"CONDITIONING"}],"properties":{"Node name for S&R":"ConditioningZeroOut"},"index":1},0,"CONDITIONING"],[{"id":-1,"type":"FluxGuidance","pos":[989.142333984375,439.9573669433594],"size":[317.4000244140625,58],"flags":{},"order":3,"mode":0,"inputs":[{"name":"conditioning","type":"CONDITIONING","link":null,"localized_name":"conditioning"}],"outputs":[{"name":"CONDITIONING","type":"CONDITIONING","links":[],"slot_index":0,"localized_name":"CONDITIONING"}],"properties":{"Node name for S&R":"FluxGuidance"},"widgets_values":[3.5],"index":0},0,"CONDITIONING"]],"config":{"0":{},"1":{},"2":{}}},"LOAD FLUX":{"nodes":[{"id":-1,"type":"UNETLoader","pos":[183.26373291015625,203.22509765625],"size":[315,82],"flags":{},"order":1,"mode":0,"inputs":[],"outputs":[{"name":"MODEL","type":"MODEL","links":[],"slot_index":0,"label":"模型","localized_name":"模型"}],"properties":{"Node name for S&R":"UNETLoader"},"widgets_values":["flux1-dev-fp8-e4m3fn.safetensors","fp8_e4m3fn"],"index":0},{"id":-1,"type":"DualCLIPLoader","pos":[187.83013916015625,330.98968505859375],"size":[315,106],"flags":{"collapsed":false},"order":2,"mode":0,"inputs":[],"outputs":[{"name":"CLIP","type":"CLIP","links":[],"slot_index":0,"label":"CLIP","localized_name":"CLIP"}],"properties":{"Node name for S&R":"DualCLIPLoader"},"widgets_values":["clip_l.safetensors","t5xxl_fp8_e4m3fn_scaled.safetensors","flux"],"index":1},{"id":-1,"type":"VAELoader","pos":[190.16644287109375,495.6625061035156],"size":[315,58],"flags":{},"order":3,"mode":0,"inputs":[],"outputs":[{"name":"VAE","type":"VAE","links":[],"slot_index":0,"localized_name":"VAE"}],"properties":{"Node name for S&R":"VAELoader"},"widgets_values":["flux-vae.safetensors"],"index":2},{"id":-1,"type":"LoraLoaderModelOnly","pos":[183.14425659179688,75.24807739257812],"size":[315,82],"flags":{},"order":6,"mode":0,"inputs":[{"name":"model","type":"MODEL","link":null,"localized_name":"模型"}],"outputs":[{"name":"MODEL","type":"MODEL","links":[],"slot_index":0,"localized_name":"模型"}],"properties":{"Node name for S&R":"LoraLoaderModelOnly"},"widgets_values":["加速\\FLUX.1-Turbo-Alpha-8step.safetensors",1],"index":3}],"links":[[0,0,3,0,13,"MODEL"]],"external":[[1,0,"CLIP"],[2,0,"VAE"]]},"UnionControlNet":{"nodes":[{"id":-1,"type":"ControlNetLoader","pos":[703.7474365234375,77.15983581542969],"size":[315,58],"flags":{},"order":2,"mode":4,"inputs":[],"outputs":[{"name":"CONTROL_NET","type":"CONTROL_NET","links":[],"slot_index":0,"localized_name":"CONTROL_NET"}],"properties":{"Node name for S&R":"ControlNetLoader"},"widgets_values":["flux\\FLUX.1-dev-Controlnet-Union-pro.safetensors"],"index":0},{"id":-1,"type":"SetUnionControlNetType","pos":[710.119384765625,182.30007934570312],"size":[315,58],"flags":{},"order":4,"mode":4,"inputs":[{"name":"control_net","type":"CONTROL_NET","link":null,"localized_name":"control_net"}],"outputs":[{"name":"CONTROL_NET","type":"CONTROL_NET","links":[],"slot_index":0,"localized_name":"CONTROL_NET"}],"properties":{"Node name for S&R":"SetUnionControlNetType"},"widgets_values":["auto"],"index":1},{"id":-1,"type":"ControlNetApplyAdvanced","pos":[705.8713989257812,284.2542724609375],"size":[315,186],"flags":{},"order":7,"mode":4,"inputs":[{"name":"positive","type":"CONDITIONING","link":null,"localized_name":"positive"},{"name":"negative","type":"CONDITIONING","link":null,"localized_name":"negative"},{"name":"control_net","type":"CONTROL_NET","link":null,"localized_name":"control_net"},{"name":"image","type":"IMAGE","link":null,"localized_name":"image"},{"name":"vae","type":"VAE","link":null,"shape":7,"localized_name":"vae"}],"outputs":[{"name":"positive","type":"CONDITIONING","links":[],"slot_index":0,"localized_name":"positive"},{"name":"negative","type":"CONDITIONING","links":[],"slot_index":1,"localized_name":"negative"}],"properties":{"Node name for S&R":"ControlNetApplyAdvanced"},"widgets_values":[0.7000000000000001,0,1],"index":2}],"links":[[0,0,1,0,23,"CONTROL_NET"],[null,0,2,0,21,"CONDITIONING"],[null,0,2,1,20,"CONDITIONING"],[1,0,2,2,24,"CONTROL_NET"],[null,1,2,4,31,"VAE"]],"external":[]},"Flux Guid":{"nodes":[{"id":-1,"type":"CLIPTextEncode","pos":[1118.4840087890625,153.2779998779297],"size":[422.84503173828125,164.31304931640625],"flags":{"collapsed":false},"order":6,"mode":0,"inputs":[{"name":"clip","type":"CLIP","link":null,"label":"CLIP","localized_name":"clip"}],"outputs":[{"name":"CONDITIONING","type":"CONDITIONING","links":[],"slot_index":0,"label":"条件","localized_name":"CONDITIONING"}],"properties":{"Node name for S&R":"CLIPTextEncode"},"widgets_values":[""],"color":"#232","bgcolor":"#353","index":0},{"id":-1,"type":"FluxGuidance","pos":[1591.4393310546875,156.94119262695312],"size":[317.4000244140625,58],"flags":{},"order":9,"mode":0,"inputs":[{"name":"conditioning","type":"CONDITIONING","link":null,"localized_name":"conditioning"}],"outputs":[{"name":"CONDITIONING","type":"CONDITIONING","links":[],"slot_index":0,"localized_name":"CONDITIONING"}],"properties":{"Node name for S&R":"FluxGuidance"},"widgets_values":[3.5],"index":1},{"id":-1,"type":"ConditioningZeroOut","pos":[1594.772216796875,287.63580322265625],"size":[317.4000244140625,26],"flags":{},"order":10,"mode":0,"inputs":[{"name":"conditioning","type":"CONDITIONING","link":null,"localized_name":"conditioning"}],"outputs":[{"name":"CONDITIONING","type":"CONDITIONING","links":[],"slot_index":0,"localized_name":"CONDITIONING"}],"properties":{"Node name for S&R":"ConditioningZeroOut"},"index":2}],"links":[[null,0,0,0,30,"CLIP"],[0,0,1,0,33,"CONDITIONING"],[0,0,2,0,33,"CONDITIONING"]],"external":[[1,0,"CONDITIONING"],[2,0,"CONDITIONING"]]}}},"version":0.4} \ No newline at end of file