diff --git a/README.md b/README.md index aea6354..3531c8e 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,7 @@ It includes: - **Upscale Machine:** High-quality model-based image upscaling with aspect-ratio preserving rescale. - **Prompt Machine:** Easy prompt selection from a CSV for positive/negative prompt workflows. - **Touchpad Pan & Zoom:** Seamless navigation for large images in the ComfyUI preview panel. +- **Resolution Machine:** Quick selection of model-specific image resolutions for popular models. --- @@ -40,6 +41,14 @@ It includes: - **Preview Navigation:** Enables smooth pan and zoom for large images in the ComfyUI preview panel. - **User Experience:** Makes inspecting high-res outputs fast and intuitive. +### 📏 Resolution Machine + +- **Model-aware Resolution Selection:** Choose from a list of recommended resolutions for each supported model. +- **Auto-populate Width/Height:** Selecting a resolution automatically fills in the correct width and height. +- **Manual Override:** You can manually set width/height, which clears the preset selection. +- **Supports Many Models:** Includes presets for SD1.5, SDXL, Illustrious XL, Pony XL, Flux.1 Dev, Qwen-Image, Wan2.2-S2V, SD3.5 Large, Lumina-Image 2.0, and more. +- **UI Integration:** Intuitive dropdowns for model and resolution selection in the ComfyUI interface. + --- ## 📦 Installation @@ -103,6 +112,24 @@ It includes: --- +### Resolution Machine + +| Name | Type | Description | +|--------------|--------|--------------------------------------------------| +| `model` | STRING | Model name (select from supported models) | +| `resolution` | STRING | Resolution preset name (auto-populates size) | +| `width` | INT | Image width (can be set manually) | +| `height` | INT | Image height (can be set manually) | + +**Outputs:** + +| Name | Type | Description | +|----------|------|----------------------------| +| `width` | INT | Final image width | +| `height` | INT | Final image height | + +--- + ## 📝 License MIT License diff --git a/__init__.py b/__init__.py index 6b60cd7..7602dfe 100644 --- a/__init__.py +++ b/__init__.py @@ -1,15 +1,17 @@ from .nodes.upscale_machine import Upscale_Machine from .nodes.prompt_machine import Prompt_Machine - +from .nodes.resolution_machine import Resolution_Machine NODE_CLASS_MAPPINGS = { "Upscale_Machine": Upscale_Machine, "Prompt_Machine": Prompt_Machine, + "Resolution_Machine": Resolution_Machine, } NODE_DISPLAY_NAME_MAPPINGS = { "Upscale_Machine": "Upscale Machine", "Prompt_Machine": "Prompt Machine", + "Resolution_Machine": "Resolution Machine", } WEB_DIRECTORY = "./web" diff --git a/nodes/prompt_machine.py b/nodes/prompt_machine.py index 7a58590..2ca7110 100644 --- a/nodes/prompt_machine.py +++ b/nodes/prompt_machine.py @@ -47,35 +47,36 @@ class Prompt_Machine: } } - RETURN_TYPES = ("STRING", "STRING") - RETURN_NAMES = ("positive", "negative") + RETURN_TYPES = ("STRING", "STRING", "STRING") + RETURN_NAMES = ("positive", "negative", "note") FUNCTION = "get_prompts" CATEGORY = "SATA_UtilityNode" def get_prompts(self, csv_file, name): if csv_file == "None" or name == "None": - return ("", "") + return ("", "", "null") path = os.path.join(CSV_DIR, csv_file) if not os.path.exists(path): print(f"[PromptMachine] CSV file not found: {path}") - return ("", "") + return ("", "", "null") with open(path, "r", encoding="utf-8-sig") as f: reader = csv.DictReader(f) if not reader.fieldnames: print(f"[PromptMachine] CSV has no header: {csv_file}") - return ("", "") + return ("", "", "null") print(f"[PromptMachine] CSV header in {csv_file}: {reader.fieldnames}") field_map = {fn.strip().lower(): fn for fn in reader.fieldnames} if "name" not in field_map: print(f"[PromptMachine] 'name' column missing in CSV: {csv_file}") - return ("", "") + return ("", "", "null") name_field = field_map["name"] pos_field = field_map.get("positive", "positive") neg_field = field_map.get("negative", "negative") + note_field = field_map.get("note", "note") for row in reader: if row.get(name_field) == name: - return (row.get(pos_field, ""), row.get(neg_field, "")) - return ("", "") + return (row.get(pos_field, ""), row.get(neg_field, ""), row.get(note_field, "")) + return ("", "", "","null") # REST endpoints for frontend refresh diff --git a/nodes/resolution_machine.py b/nodes/resolution_machine.py new file mode 100644 index 0000000..534ec57 --- /dev/null +++ b/nodes/resolution_machine.py @@ -0,0 +1,201 @@ +# resolution_machine.py +from server import PromptServer +from aiohttp import web + +class Resolution_Machine: + CATEGORY = "SATA_UtilityNode" + + @classmethod + def _get_config(cls): + """Hard-coded model->resolutions JSON. We append a 'Custom (manual)' entry + to every model to avoid validation failures when user edits width/height manually. + """ + cfg = { + "models": [ + { + "model": "SD1.5", + "resolutions": [ + { "name": "Square (1:1)", "width": 512, "height": 512 }, + { "name": "Square high-res (1:1)", "width": 768, "height": 768 }, + { "name": "Landscape (3:2)", "width": 768, "height": 512 }, + { "name": "Portrait (2:3)", "width": 512, "height": 768 }, + { "name": "Landscape (4:3)", "width": 768, "height": 576 }, + { "name": "Portrait (3:4)", "width": 576, "height": 768 }, + { "name": "Widescreen (16:9)", "width": 912, "height": 512 }, + { "name": "Tall (9:16)", "width": 512, "height": 912 } + ] + }, + { + "model": "SDXL", + "resolutions": [ + { "name": "Square (1:1 native)", "width": 1024, "height": 1024 }, + { "name": "Portrait (2:3)", "width": 832, "height": 1248 }, + { "name": "Standard (3:4)", "width": 880, "height": 1176 }, + { "name": "Large Format (4:5)", "width": 912, "height": 1144 }, + { "name": "SD TV (4:3)", "width": 1176, "height": 888 }, + { "name": "IMAX (1.43:1)", "width": 1224, "height": 856 }, + { "name": "Golden Ratio (1.618:1)", "width": 1296, "height": 800 }, + { "name": "European Widescreen (1.66:1)", "width": 1312, "height": 792 }, + { "name": "Widescreen / HD TV (16:9)", "width": 1360, "height": 768 }, + { "name": "Standard Widescreen (1.85:1)", "width": 1392, "height": 752 }, + { "name": "Cinemascope / Panavision (2.35:1)", "width": 1568, "height": 664 }, + { "name": "Anamorphic Widescreen (2.39:1)", "width": 1576, "height": 656 }, + { "name": "Older TV & Documentaries (4:3)", "width": 1176, "height": 880 } + ] + }, + { + "model": "Illustrious XL v1.0", + "resolutions": [ + { "name": "Minimum training bound", "width": 512, "height": 512 }, + { "name": "Non-standard example", "width": 1248, "height": 1824 }, + { "name": "Native high-res support", "width": 1536, "height": 1536 } + ] + }, + { + "model": "Illustrious XL v3.0", + "resolutions": [ + { "name": "Minimum usable", "width": 256, "height": 256 }, + { "name": "Standard high-res", "width": 1536, "height": 1536 }, + { "name": "Maximum native", "width": 2048, "height": 2048 } + ] + }, + { + "model": "Pony XL", + "resolutions": [ + { "name": "Portrait-tall", "width": 832, "height": 1216 }, + { "name": "Landscape-wide", "width": 1216, "height": 832 }, + { "name": "Square (1:1)", "width": 1024, "height": 1024 } + ] + }, + { + "model": "Flux.1 Dev", + "resolutions": [ + { "name": "512×512 (1 MP quick test)", "width": 512, "height": 512 }, + { "name": "1024×1024 (daily work)", "width": 1024, "height": 1024 }, + { "name": "1600×1600 (detailed work)", "width": 1600, "height": 1600 }, + { "name": "1920×1080 (HD)", "width": 1920, "height": 1080 }, + { "name": "2560×1440 (QHD)", "width": 2560, "height": 1440 }, + { "name": "3840×2160 (4K)", "width": 3840, "height": 2160 } + ] + }, + { + "model": "Qwen-Image", + "resolutions": [ + { "name": "Square (1:1)", "width": 1328, "height": 1328 }, + { "name": "Widescreen (16:9)", "width": 1664, "height": 928 }, + { "name": "Tall (9:16)", "width": 928, "height": 1664 }, + { "name": "Landscape (4:3)", "width": 1472, "height": 1140 }, + { "name": "Portrait (3:4)", "width": 1140, "height": 1472 } + ] + }, + { + "model": "Wan2.2-S2V", + "resolutions": [ + { "name": "720p HD video", "width": 1280, "height": 720 } + ] + }, + { + "model": "SD3.5 Large", + "resolutions": [ + { "name": "768×1152 (best portrait)", "width": 768, "height": 1152 }, + { "name": "1152×768 (best landscape)", "width": 1152, "height": 768 }, + { "name": "1024×1024 (square)", "width": 1024, "height": 1024 }, + { "name": "768×768 (quick test)", "width": 768, "height": 768 }, + { "name": "832×1216 portrait", "width": 832, "height": 1216 }, + { "name": "1216×832 landscape", "width": 1216, "height": 832 } + ] + }, + { + "model": "Lumina-Image 2.0", + "resolutions": [ + { "name": "Default (1 MP square)", "width": 1024, "height": 1024 } + ] + } + ] + } + + # Append Custom option to every model's resolutions (idempotent) + for m in cfg["models"]: + if not any(r["name"] == "Custom (manual)" for r in m.get("resolutions", [])): + m.setdefault("resolutions", []).append({"name": "Custom (manual)", "width": 0, "height": 0}) + + return cfg + + @classmethod + def INPUT_TYPES(cls, context=None): + """Return model list and compile a global (deterministic) resolution list. + We return a list[str] for 'resolution' so ComfyUI always creates a COMBO dropdown. + """ + cfg = cls._get_config() + + # models (keep order) + models = [m["model"] for m in cfg["models"]] + + # Build a deterministic list of unique resolution names (preserve model order) + seen = set() + all_resolutions = [] + for m in cfg["models"]: + for r in m.get("resolutions", []): + name = r.get("name") + if name and name not in seen: + seen.add(name) + all_resolutions.append(name) + + # Guarantee non-empty list (shouldn't be needed, but defensive) + if not all_resolutions: + all_resolutions = ["Custom (manual)"] + + # default model & default resolution (first non-custom of default model preferred) + default_model = models[0] if models else "" + default_res = None + model_obj = next((m for m in cfg["models"] if m["model"] == default_model), None) + if model_obj: + first_non_custom = next((r for r in model_obj["resolutions"] if r["name"] != "Custom (manual)"), None) + if first_non_custom: + default_res = first_non_custom["name"] + else: + default_res = model_obj["resolutions"][0]["name"] + if not default_res: + default_res = all_resolutions[0] + + # default width/height derived from selected default resolution / model + default_width = 512 + default_height = 512 + if model_obj and default_res: + res_obj = next((r for r in model_obj["resolutions"] if r["name"] == default_res), None) + if res_obj: + default_width = res_obj["width"] + default_height = res_obj["height"] + + return { + "required": { + "model": (models if models else ["null"], {"default": default_model}), + # Declare as list[str] so ComfyUI builds a COMBO dropdown reliably. + "resolution": (all_resolutions, {"default": default_res, "forceInput": True, "force_input": True}), + "width": ("INT", {"default": default_width, "min": 1, "max": 16384, "step": 1}), + "height": ("INT", {"default": default_height, "min": 1, "max": 16384, "step": 1}), + } + } + + RETURN_TYPES = ("INT", "INT") + RETURN_NAMES = ("width", "height") + FUNCTION = "run" + + def run(self, model, resolution, width, height): + """If the chosen resolution exists for the selected model and is not Custom, + return the predefined width & height; otherwise return manual values. + """ + cfg = self._get_config() + model_obj = next((m for m in cfg["models"] if m["model"] == model), None) + if model_obj and resolution and resolution != "Custom (manual)": + res_obj = next((r for r in model_obj["resolutions"] if r["name"] == resolution), None) + if res_obj: + return res_obj["width"], res_obj["height"] + # fallback -> manual + return width, height + + +# REST endpoint so frontend can fetch the full mapping (optional but useful) +@PromptServer.instance.routes.get("/sata/resolution_machine/config") +async def get_resolution_config(request): + return web.json_response(Resolution_Machine._get_config()) \ No newline at end of file diff --git a/prompts/prompts.csv b/prompts/prompts.csv index 81d2945..c1d5312 100644 --- a/prompts/prompts.csv +++ b/prompts/prompts.csv @@ -1,74 +1,74 @@ -name,positive,negative -Photon1,,"cartoon, painting, illustration, (worst quality, low quality, normal quality:2)" -RealVis,"RAW photo, subject, 8k uhd, dslr, soft lighting, high quality, film grain, Fujifilm XT3","(deformed iris, deformed pupils, semi-realistic, cgi, 3d, render, sketch, cartoon, drawing, anime, mutated hands and fingers:1.4), (deformed, distorted, disfigured:1.3), poorly drawn, bad anatomy, wrong anatomy, extra limb, missing limb, floating limbs, disconnected limbs, mutation, mutated, ugly, disgusting, amputation, UnrealisticDream" -RevAnime,"((best quality)), ((masterpiece)), (detailed) ", -Chibi,"full body, chibi, highly detailed","photo, black and white, low contrast" -Default_Negative,,"Watermark, Text, censored, deformed, bad anatomy, disfigured, poorly drawn face, mutated, extra limb, ugly, poorly drawn hands, missing limb, floating limbs, disconnected limbs, disconnected head, malformed hands, long neck, mutated hands and fingers, bad hands, missing fingers, cropped, worst quality, low quality, mutation, poorly drawn, huge calf, bad hands, fused hand, missing hand, disappearing arms, disappearing thigh, disappearing calf, disappearing legs, missing fingers, fused fingers, abnormal eye proportion, Abnormal hands, abnormal legs, abnormal feet, abnormal fingers" -Default_Negative (sfw),,"NSFW, Cleavage, Pubic Hair, Nudity, Naked, Au naturel, Watermark, Text, censored, deformed, bad anatomy, disfigured, poorly drawn face, mutated, extra limb, ugly, poorly drawn hands, missing limb, floating limbs, disconnected limbs, disconnected head, malformed hands, long neck, mutated hands and fingers, bad hands, missing fingers, cropped, worst quality, low quality, mutation, poorly drawn, huge calf, bad hands, fused hand, missing hand, disappearing arms, disappearing thigh, disappearing calf, disappearing legs, missing fingers, fused fingers, abnormal eye proportion, Abnormal hands, abnormal legs, abnormal feet, abnormal fingers" -Default_Negative (Low Token),,"lowres, bad anatomy, bad hands, text, error, missing fingers, extra digit, fewer digits, cropped, worst quality, low quality, normal quality, jpeg artifacts, signature, watermark, username, blurry" -3d-model,"professional 3d model {prompt}, octane render, highly detailed, volumetric, dramatic lighting","ugly, deformed, noisy, low poly, blurry, painting" -Analog film,"analog film photo {prompt}, faded film, desaturated, 35mm photo, grainy, vignette, vintage, Kodachrome, Lomography, stained, highly detailed, found footage","painting, drawing, illustration, glitch, deformed, mutated, cross-eyed, ugly, disfigured" -Anime,"anime artwork {prompt}, anime style, key visual, vibrant, studio anime, highly detailed","photo, deformed, black and white, realism, disfigured, low contrast" -Biomechanical,"biomechanical style {prompt}, blend of organic and mechanical elements, futuristic, cybernetic, detailed, intricate","natural, rustic, primitive, organic, simplistic" -Cinematic,"cinematic film still {prompt}, shallow depth of field, vignette, highly detailed, high budget Hollywood film, bokeh, cinemascope, moody, epic, gorgeous, film grain","anime, cartoon, graphic, text, painting, crayon, graphite, abstract, glitch" -Comic book,"comic {prompt}, graphic illustration, comic art, graphic novel art, vibrant, highly detailed","photograph, deformed, glitch, noisy, realistic, stock photo" -Cyberpunk,"neonpunk style {prompt}, cyberpunk, vaporwave, neon, vibes, vibrant, stunningly beautiful, crisp, detailed, sleek, ultramodern, magenta highlights, dark purple shadows, high contrast, cinematic, ultra detailed, intricate, professional","painting, drawing, illustration, glitch, deformed, mutated, cross-eyed, ugly, disfigured" -Digital art,"concept art {prompt}, digital artwork, illustrative, painterly, matte painting, highly detailed","photo, photorealistic, realism, ugly" -Dreamscape,"dreamscape {prompt}, surreal, ethereal, dreamy, mysterious, fantasy, highly detailed","realistic, concrete, ordinary, mundane" -Dystopian,"dystopian style {prompt}, bleak, post-apocalyptic, somber, dramatic, highly detailed","ugly, deformed, noisy, blurry, low contrast, cheerful, optimistic, vibrant, colorful" -Fantasy art,"ethereal fantasy concept art of {prompt}, magnificent, celestial, ethereal, painterly, epic, majestic, magical, fantasy art, cover art, dreamy","photographic, realistic, realism, 35mm film, dslr, cropped, frame, text, deformed, glitch, noise, noisy, off-center, deformed, cross-eyed, closed eyes, bad anatomy, ugly, disfigured, sloppy, duplicate, mutated, black and white" -Futuristic,"futuristic style {prompt}, sleek, modern, ultramodern, high tech, detailed","ugly, deformed, noisy, blurry, low contrast, realism, photorealistic, vintage, antique" -Horror,"horror-themed {prompt}, eerie, unsettling, dark, spooky, suspenseful, grim, highly detailed","cheerful, bright, vibrant, light-hearted, cute" -Isometric,"isometric style {prompt}, vibrant, beautiful, crisp, detailed, ultra detailed, intricate","deformed, mutated, ugly, disfigured, blur, blurry, noise, noisy, realistic, photographic" -Manga,"manga style {prompt}, vibrant, high-energy, detailed, iconic, Japanese comic style","ugly, deformed, noisy, blurry, low contrast, realism, photorealistic, Western comic style" -Photo with Bokeh,"cinematic photo {prompt}, 35mm photograph, film, bokeh, professional, 4k, highly detailed","drawing, painting, crayon, sketch, graphite, impressionist, noisy, blurry, soft, deformed, ugly" -Photo without Bokeh,"cinematic photo {prompt}, 35mm photograph, film, professional, 4k, highly detailed","bokeh, drawing, painting, crayon, sketch, graphite, impressionist, noisy, blurry, soft, deformed, ugly" -Photo Long Exposure,"long exposure photo of {prompt}, Blurred motion, streaks of light, surreal, dreamy, ghosting effect, highly detailed","static, noisy, deformed, shaky, abrupt, flat" -Photo Film Noir,"film noir style {prompt}, monochrome, high contrast, dramatic shadows, 1940s style, mysterious, cinematic","ugly, deformed, noisy, blurry, low contrast, vibrant, colorful" -Pixel Art,"pixel-art {prompt}, low-res, blocky, pixel art style, 8-bit graphics","sloppy, messy, blurry, noisy, highly detailed, ultra textured, photo, realistic" -Pixar Style,"pixar style render, caricature, {prompt}, looking at viewer, flat colors, 4k, professional, award-winning, highly detailed, volumetric, dramatic lighting","low poly, painting, realistic, photo, line drawing" -Sci-fi,"sci-fi style {prompt}, futuristic, technological, space themes, advanced civilizations, light leaks, lens flares","ugly, deformed, noisy, blurry, low contrast, historical, medieval" -Steampunk,"steampunk style {prompt}, antique, mechanical, brass and copper tones, gears, intricate, detailed","deformed, glitch, noisy, low contrast, anime, photorealistic" -Watercolor,"watercolor painting {prompt}, vibrant, beautiful, painterly, detailed, textural, artistic","anime, photorealistic, 35mm film, deformed, glitch, low contrast, noisy" -Character Reference Sheet,"character reference sheet {prompt}, turnaround views, detailed anatomy, color palette, multiple poses, highly detailed","simplistic, minimalist, vague, incomplete" -Enhancer,"breathtaking {prompt}, masterpiece, award-winning, professional, highly detailed","ugly, deformed, noisy, blurry, distorted, grainy" -Lighting: Artificial,artificial light, -Lighting: Back,back lighting, -Lighting: Bottom,bottom lighting, -Lighting: Chiaroscuro,chiaroscuro lighting, -Lighting: Cinematic,cinematic lighting, -Lighting: Dramatic,dramatic lighting, -Lighting: High key,high key lighting, -Lighting: Low key,low key lighting, -Lighting: Natural,natural light, -Lighting: Rembrandt,Rembrandt lighting, -Lighting: Rim,rim lighting, -Lighting: Side,side lighting, -Lighting: Split,split lighting, -Lighting: Top,top lighting, -"Cotton, Fine","{prompt} in fine cotton fabric, highly detailed, gorgeous, matte fabric","anime, graphic, text, painting, crayon, graphite, glitch, cartoon, ugly, deformed, noisy, blurry, distorted" -"Cotton, Regular","{prompt} dress in heavy knit cotton fabric, matte fabric, gorgeous cloth, highly detailed, cinematic","wrinkles, linen, seethrough, transparent, anime, graphic, text, painting, crayon, graphite, glitch, cartoon, ugly, deformed, noisy, blurry, distorted" -Denim,"{prompt} in heavy japanese (denim fabric), highly detailed, hard drape","anime, graphic, text, painting, crayon, graphite, glitch, cartoon, ugly, deformed, noisy, blurry, distorted" -"Flannel, Brushed","{prompt} in soft woven brushed flannel, highly detailed, fuzzy flannel cloth, cashmere flannel","anime, graphic, text, painting, crayon, graphite, glitch, cartoon, ugly, deformed, noisy, blurry, distorted" -Latex/Plastic,"{prompt} dress in shiny latex plastic material, expensive exquisite latex fabric, tight fitting","metallic, nude, naked, fabric wrinkles, anime, graphic, text, painting, crayon, graphite, glitch, cartoon, ugly, deformed, noisy, blurry, distorted" -"Latex/Plastic, Glossy","{prompt} in shiny wet glossy latex material, hard lighting, expensive exquisite latex fabric, tight fitting","metallic, nude, naked, fabric wrinkles, anime, graphic, text, painting, crayon, graphite, glitch, cartoon, ugly, deformed, noisy, blurry, distorted" -Leather,"{prompt} in smooth thin leather, highly detailed, expensive exquisite leather","anime, graphic, text, painting, crayon, graphite, glitch, cartoon, ugly, deformed, noisy, blurry, distorted" -Linen,"{prompt} in linen fabric, loosely woven, gorgeous cloth, highly detailed","anime, graphic, text, painting, crayon, graphite, glitch, cartoon, ugly, deformed, noisy, blurry, distorted" -Silk,"{prompt} in silk cloth, highly detailed, gorgeous, sheen lustre","anime, graphic, text, painting, crayon, graphite, glitch, cartoon, ugly, deformed, noisy, blurry, distorted" -Velvet,"{prompt} in smooth velvet fabric, gorgeous exquisite cloth, highly detailed, fuzzy velvet cloth, expensive","anime, graphic, text, painting, crayon, graphite, glitch, cartoon, ugly, deformed, noisy, blurry, distorted" -"Wool, Fine knit","{prompt} in wool cloth, highly detailed, gorgeous, fine knit cashmere wool fabric","anime, graphic, text, painting, crayon, graphite, glitch, cartoon, ugly, deformed, noisy, blurry, distorted" -"Wool, Heavy knit","{prompt} in chunky heavy wool yarn, highly detailed, heavy knit large wool fabric, sailor's wool","anime, graphic, text, painting, crayon, graphite, glitch, cartoon, ugly, deformed, noisy, blurry, distorted" -"Wool, Cable knit","{prompt} in chunky heavy cable knit wool yarn, highly detailed, cable knit large wool fabric","anime, graphic, text, painting, crayon, graphite, glitch, cartoon, ugly, deformed, noisy, blurry, distorted" -Ghibli,"(Studio ghibli style, Art by Hayao Miyazaki:1.2), Anime Style, Manga Style, Hand drawn, cinematic, Sharp focus, humorous illustration, big depth of field, Masterpiece, concept art, trending on artstation, Vivid colors, Simplified style, trending on ArtStation, trending on CGSociety, Intricate, Vibrant colors, Soft Shading, Simplistic Features, Sharp Angles, Playful", -Vector Illustrations,"Vector art, Vivid colors, Clean lines, Sharp edges, Minimalist, Precise geometry, Simplistic, Smooth curves, Bold outlines, Crisp shapes, Flat colors, Illustration art piece, High contrast shadows, Technical illustration, Graphic design, Vector graphics, High contrast, Precision artwork, Linear compositions, Scalable artwork, Digital art", -Digital Painting,"glow effects, godrays, Hand drawn, render, 8k, octane render, cinema 4d, blender, dark, atmospheric 4k ultra detailed, cinematic, Sharp focus, big depth of field, Masterpiece, colors, 3d octane render, 4k, concept art, trending on artstation, hyperrealistic, Vivid colors, extremely detailed CG unity 8k wallpaper, trending on CGSociety, Intricate, High Detail, dramatic", -Indie Game,"Indie game art, Vector Art, Borderlands style, Arcane style, Cartoon style, Line art, Disctinct features, Hand drawn, Technical illustration, Graphic design, Vector graphics, High contrast, Precision artwork, Linear compositions, Scalable artwork, Digital art, cinematic sensual, Sharp focus, humorous illustration, big depth of field, Masterpiece, trending on artstation, Vivid colors, trending on ArtStation, trending on CGSociety, Intricate, Low Detail, dramatic", -Original Photo Style,"Photorealistic, Hyperrealistic, Hyperdetailed, analog style, soft lighting, subsurface scattering, realistic, heavy shadow, masterpiece, best quality, ultra realistic, 8k, golden ratio, Intricate, High Detail, film photography, soft focus", -Black and White Film Noir,"(b&w, Monochromatic, Film Photography:1.3), Photorealistic, Hyperrealistic, Hyperdetailed, film noir, analog style, soft lighting, subsurface scattering, realistic, heavy shadow, masterpiece, best quality, ultra realistic, 8k, golden ratio, Intricate, High Detail, film photography, soft focus", -Isometric Rooms,"Tiny cute isometric in a cutaway box, soft smooth lighting, soft colors, 100mm lens, 3d blender render", -Space Hologram,"hologram floating in space, a vibrant digital illustration, dribbble, quantum wavetracing, black background, behance hd", -Cute Creatures,"3d fluffy, closeup cute and adorable, cute big circular reflective eyes, long fuzzy fur, Pixar render, unreal engine cinematic smooth, intricate detail, cinematic", -Realistic Photo Portraits,"RAW candid cinema, 16mm, color graded portra 400 film, remarkable color, ultra realistic, textured skin, remarkable detailed pupils, realistic dull skin noise, visible skin detail, skin fuzz, dry skin, shot with cinematic camera", -Professional Scenic Photographs,"long shot scenic professional photograph of {prompt}, perfect viewpoint, highly detailed, wide-angle lens, hyper realistic, with dramatic sky, polarizing filter, natural lighting, vivid colors, everything in sharp focus, HDR, UHD, 64K", -Skin Enhancer,"detailed skin texture, (blush:0.5), (goosebumps:0.5), subsurface scattering, dry skin, fuzzy skin", -Skin Enhancer (clean),"detailed skin texture, (blush:0.2), (goosebumps:0.3), subsurface scattering, dry skin, fuzzy skin", +name,positive,negative,note +Photon1,,"cartoon, painting, illustration, (worst quality, low quality, normal quality:2)",sd1.5 +RealVis,"RAW photo, subject, 8k uhd, dslr, soft lighting, high quality, film grain, Fujifilm XT3","(deformed iris, deformed pupils, semi-realistic, cgi, 3d, render, sketch, cartoon, drawing, anime, mutated hands and fingers:1.4), (deformed, distorted, disfigured:1.3), poorly drawn, bad anatomy, wrong anatomy, extra limb, missing limb, floating limbs, disconnected limbs, mutation, mutated, ugly, disgusting, amputation, UnrealisticDream",sd1.5 +RevAnime,"((best quality)), ((masterpiece)), (detailed) ",,sd1.5 +Chibi,"full body, chibi, highly detailed","photo, black and white, low contrast",lora +Default_Negative,,"Watermark, Text, censored, deformed, bad anatomy, disfigured, poorly drawn face, mutated, extra limb, ugly, poorly drawn hands, missing limb, floating limbs, disconnected limbs, disconnected head, malformed hands, long neck, mutated hands and fingers, bad hands, missing fingers, cropped, worst quality, low quality, mutation, poorly drawn, huge calf, bad hands, fused hand, missing hand, disappearing arms, disappearing thigh, disappearing calf, disappearing legs, missing fingers, fused fingers, abnormal eye proportion, Abnormal hands, abnormal legs, abnormal feet, abnormal fingers", +Default_Negative (sfw),,"NSFW, Cleavage, Pubic Hair, Nudity, Naked, Au naturel, Watermark, Text, censored, deformed, bad anatomy, disfigured, poorly drawn face, mutated, extra limb, ugly, poorly drawn hands, missing limb, floating limbs, disconnected limbs, disconnected head, malformed hands, long neck, mutated hands and fingers, bad hands, missing fingers, cropped, worst quality, low quality, mutation, poorly drawn, huge calf, bad hands, fused hand, missing hand, disappearing arms, disappearing thigh, disappearing calf, disappearing legs, missing fingers, fused fingers, abnormal eye proportion, Abnormal hands, abnormal legs, abnormal feet, abnormal fingers", +Default_Negative (Low Token),,"lowres, bad anatomy, bad hands, text, error, missing fingers, extra digit, fewer digits, cropped, worst quality, low quality, normal quality, jpeg artifacts, signature, watermark, username, blurry", +3d-model,"professional 3d model {prompt}, octane render, highly detailed, volumetric, dramatic lighting","ugly, deformed, noisy, low poly, blurry, painting", +Analog film,"analog film photo {prompt}, faded film, desaturated, 35mm photo, grainy, vignette, vintage, Kodachrome, Lomography, stained, highly detailed, found footage","painting, drawing, illustration, glitch, deformed, mutated, cross-eyed, ugly, disfigured", +Anime,"anime artwork {prompt}, anime style, key visual, vibrant, studio anime, highly detailed","photo, deformed, black and white, realism, disfigured, low contrast", +Biomechanical,"biomechanical style {prompt}, blend of organic and mechanical elements, futuristic, cybernetic, detailed, intricate","natural, rustic, primitive, organic, simplistic", +Cinematic,"cinematic film still {prompt}, shallow depth of field, vignette, highly detailed, high budget Hollywood film, bokeh, cinemascope, moody, epic, gorgeous, film grain","anime, cartoon, graphic, text, painting, crayon, graphite, abstract, glitch", +Comic book,"comic {prompt}, graphic illustration, comic art, graphic novel art, vibrant, highly detailed","photograph, deformed, glitch, noisy, realistic, stock photo", +Cyberpunk,"neonpunk style {prompt}, cyberpunk, vaporwave, neon, vibes, vibrant, stunningly beautiful, crisp, detailed, sleek, ultramodern, magenta highlights, dark purple shadows, high contrast, cinematic, ultra detailed, intricate, professional","painting, drawing, illustration, glitch, deformed, mutated, cross-eyed, ugly, disfigured", +Digital art,"concept art {prompt}, digital artwork, illustrative, painterly, matte painting, highly detailed","photo, photorealistic, realism, ugly", +Dreamscape,"dreamscape {prompt}, surreal, ethereal, dreamy, mysterious, fantasy, highly detailed","realistic, concrete, ordinary, mundane", +Dystopian,"dystopian style {prompt}, bleak, post-apocalyptic, somber, dramatic, highly detailed","ugly, deformed, noisy, blurry, low contrast, cheerful, optimistic, vibrant, colorful", +Fantasy art,"ethereal fantasy concept art of {prompt}, magnificent, celestial, ethereal, painterly, epic, majestic, magical, fantasy art, cover art, dreamy","photographic, realistic, realism, 35mm film, dslr, cropped, frame, text, deformed, glitch, noise, noisy, off-center, deformed, cross-eyed, closed eyes, bad anatomy, ugly, disfigured, sloppy, duplicate, mutated, black and white", +Futuristic,"futuristic style {prompt}, sleek, modern, ultramodern, high tech, detailed","ugly, deformed, noisy, blurry, low contrast, realism, photorealistic, vintage, antique", +Horror,"horror-themed {prompt}, eerie, unsettling, dark, spooky, suspenseful, grim, highly detailed","cheerful, bright, vibrant, light-hearted, cute", +Isometric,"isometric style {prompt}, vibrant, beautiful, crisp, detailed, ultra detailed, intricate","deformed, mutated, ugly, disfigured, blur, blurry, noise, noisy, realistic, photographic", +Manga,"manga style {prompt}, vibrant, high-energy, detailed, iconic, Japanese comic style","ugly, deformed, noisy, blurry, low contrast, realism, photorealistic, Western comic style", +Photo with Bokeh,"cinematic photo {prompt}, 35mm photograph, film, bokeh, professional, 4k, highly detailed","drawing, painting, crayon, sketch, graphite, impressionist, noisy, blurry, soft, deformed, ugly", +Photo without Bokeh,"cinematic photo {prompt}, 35mm photograph, film, professional, 4k, highly detailed","bokeh, drawing, painting, crayon, sketch, graphite, impressionist, noisy, blurry, soft, deformed, ugly", +Photo Long Exposure,"long exposure photo of {prompt}, Blurred motion, streaks of light, surreal, dreamy, ghosting effect, highly detailed","static, noisy, deformed, shaky, abrupt, flat", +Photo Film Noir,"film noir style {prompt}, monochrome, high contrast, dramatic shadows, 1940s style, mysterious, cinematic","ugly, deformed, noisy, blurry, low contrast, vibrant, colorful", +Pixel Art,"pixel-art {prompt}, low-res, blocky, pixel art style, 8-bit graphics","sloppy, messy, blurry, noisy, highly detailed, ultra textured, photo, realistic", +Pixar Style,"pixar style render, caricature, {prompt}, looking at viewer, flat colors, 4k, professional, award-winning, highly detailed, volumetric, dramatic lighting","low poly, painting, realistic, photo, line drawing", +Sci-fi,"sci-fi style {prompt}, futuristic, technological, space themes, advanced civilizations, light leaks, lens flares","ugly, deformed, noisy, blurry, low contrast, historical, medieval", +Steampunk,"steampunk style {prompt}, antique, mechanical, brass and copper tones, gears, intricate, detailed","deformed, glitch, noisy, low contrast, anime, photorealistic", +Watercolor,"watercolor painting {prompt}, vibrant, beautiful, painterly, detailed, textural, artistic","anime, photorealistic, 35mm film, deformed, glitch, low contrast, noisy", +Character Reference Sheet,"character reference sheet {prompt}, turnaround views, detailed anatomy, color palette, multiple poses, highly detailed","simplistic, minimalist, vague, incomplete", +Enhancer,"breathtaking {prompt}, masterpiece, award-winning, professional, highly detailed","ugly, deformed, noisy, blurry, distorted, grainy", +Lighting: Artificial,artificial light,, +Lighting: Back,back lighting,, +Lighting: Bottom,bottom lighting,, +Lighting: Chiaroscuro,chiaroscuro lighting,, +Lighting: Cinematic,cinematic lighting,, +Lighting: Dramatic,dramatic lighting,, +Lighting: High key,high key lighting,, +Lighting: Low key,low key lighting,, +Lighting: Natural,natural light,, +Lighting: Rembrandt,Rembrandt lighting,, +Lighting: Rim,rim lighting,, +Lighting: Side,side lighting,, +Lighting: Split,split lighting,, +Lighting: Top,top lighting,, +"Cotton, Fine","{prompt} in fine cotton fabric, highly detailed, gorgeous, matte fabric","anime, graphic, text, painting, crayon, graphite, glitch, cartoon, ugly, deformed, noisy, blurry, distorted", +"Cotton, Regular","{prompt} dress in heavy knit cotton fabric, matte fabric, gorgeous cloth, highly detailed, cinematic","wrinkles, linen, seethrough, transparent, anime, graphic, text, painting, crayon, graphite, glitch, cartoon, ugly, deformed, noisy, blurry, distorted", +Denim,"{prompt} in heavy japanese (denim fabric), highly detailed, hard drape","anime, graphic, text, painting, crayon, graphite, glitch, cartoon, ugly, deformed, noisy, blurry, distorted", +"Flannel, Brushed","{prompt} in soft woven brushed flannel, highly detailed, fuzzy flannel cloth, cashmere flannel","anime, graphic, text, painting, crayon, graphite, glitch, cartoon, ugly, deformed, noisy, blurry, distorted", +Latex/Plastic,"{prompt} dress in shiny latex plastic material, expensive exquisite latex fabric, tight fitting","metallic, nude, naked, fabric wrinkles, anime, graphic, text, painting, crayon, graphite, glitch, cartoon, ugly, deformed, noisy, blurry, distorted", +"Latex/Plastic, Glossy","{prompt} in shiny wet glossy latex material, hard lighting, expensive exquisite latex fabric, tight fitting","metallic, nude, naked, fabric wrinkles, anime, graphic, text, painting, crayon, graphite, glitch, cartoon, ugly, deformed, noisy, blurry, distorted", +Leather,"{prompt} in smooth thin leather, highly detailed, expensive exquisite leather","anime, graphic, text, painting, crayon, graphite, glitch, cartoon, ugly, deformed, noisy, blurry, distorted", +Linen,"{prompt} in linen fabric, loosely woven, gorgeous cloth, highly detailed","anime, graphic, text, painting, crayon, graphite, glitch, cartoon, ugly, deformed, noisy, blurry, distorted", +Silk,"{prompt} in silk cloth, highly detailed, gorgeous, sheen lustre","anime, graphic, text, painting, crayon, graphite, glitch, cartoon, ugly, deformed, noisy, blurry, distorted", +Velvet,"{prompt} in smooth velvet fabric, gorgeous exquisite cloth, highly detailed, fuzzy velvet cloth, expensive","anime, graphic, text, painting, crayon, graphite, glitch, cartoon, ugly, deformed, noisy, blurry, distorted", +"Wool, Fine knit","{prompt} in wool cloth, highly detailed, gorgeous, fine knit cashmere wool fabric","anime, graphic, text, painting, crayon, graphite, glitch, cartoon, ugly, deformed, noisy, blurry, distorted", +"Wool, Heavy knit","{prompt} in chunky heavy wool yarn, highly detailed, heavy knit large wool fabric, sailor's wool","anime, graphic, text, painting, crayon, graphite, glitch, cartoon, ugly, deformed, noisy, blurry, distorted", +"Wool, Cable knit","{prompt} in chunky heavy cable knit wool yarn, highly detailed, cable knit large wool fabric","anime, graphic, text, painting, crayon, graphite, glitch, cartoon, ugly, deformed, noisy, blurry, distorted", +Ghibli,"(Studio ghibli style, Art by Hayao Miyazaki:1.2), Anime Style, Manga Style, Hand drawn, cinematic, Sharp focus, humorous illustration, big depth of field, Masterpiece, concept art, trending on artstation, Vivid colors, Simplified style, trending on ArtStation, trending on CGSociety, Intricate, Vibrant colors, Soft Shading, Simplistic Features, Sharp Angles, Playful",, +Vector Illustrations,"Vector art, Vivid colors, Clean lines, Sharp edges, Minimalist, Precise geometry, Simplistic, Smooth curves, Bold outlines, Crisp shapes, Flat colors, Illustration art piece, High contrast shadows, Technical illustration, Graphic design, Vector graphics, High contrast, Precision artwork, Linear compositions, Scalable artwork, Digital art",, +Digital Painting,"glow effects, godrays, Hand drawn, render, 8k, octane render, cinema 4d, blender, dark, atmospheric 4k ultra detailed, cinematic, Sharp focus, big depth of field, Masterpiece, colors, 3d octane render, 4k, concept art, trending on artstation, hyperrealistic, Vivid colors, extremely detailed CG unity 8k wallpaper, trending on CGSociety, Intricate, High Detail, dramatic",, +Indie Game,"Indie game art, Vector Art, Borderlands style, Arcane style, Cartoon style, Line art, Disctinct features, Hand drawn, Technical illustration, Graphic design, Vector graphics, High contrast, Precision artwork, Linear compositions, Scalable artwork, Digital art, cinematic sensual, Sharp focus, humorous illustration, big depth of field, Masterpiece, trending on artstation, Vivid colors, trending on ArtStation, trending on CGSociety, Intricate, Low Detail, dramatic",, +Original Photo Style,"Photorealistic, Hyperrealistic, Hyperdetailed, analog style, soft lighting, subsurface scattering, realistic, heavy shadow, masterpiece, best quality, ultra realistic, 8k, golden ratio, Intricate, High Detail, film photography, soft focus",, +Black and White Film Noir,"(b&w, Monochromatic, Film Photography:1.3), Photorealistic, Hyperrealistic, Hyperdetailed, film noir, analog style, soft lighting, subsurface scattering, realistic, heavy shadow, masterpiece, best quality, ultra realistic, 8k, golden ratio, Intricate, High Detail, film photography, soft focus",, +Isometric Rooms,"Tiny cute isometric in a cutaway box, soft smooth lighting, soft colors, 100mm lens, 3d blender render",, +Space Hologram,"hologram floating in space, a vibrant digital illustration, dribbble, quantum wavetracing, black background, behance hd",, +Cute Creatures,"3d fluffy, closeup cute and adorable, cute big circular reflective eyes, long fuzzy fur, Pixar render, unreal engine cinematic smooth, intricate detail, cinematic",, +Realistic Photo Portraits,"RAW candid cinema, 16mm, color graded portra 400 film, remarkable color, ultra realistic, textured skin, remarkable detailed pupils, realistic dull skin noise, visible skin detail, skin fuzz, dry skin, shot with cinematic camera",, +Professional Scenic Photographs,"long shot scenic professional photograph of {prompt}, perfect viewpoint, highly detailed, wide-angle lens, hyper realistic, with dramatic sky, polarizing filter, natural lighting, vivid colors, everything in sharp focus, HDR, UHD, 64K",, +Skin Enhancer,"detailed skin texture, (blush:0.5), (goosebumps:0.5), subsurface scattering, dry skin, fuzzy skin",, +Skin Enhancer (clean),"detailed skin texture, (blush:0.2), (goosebumps:0.3), subsurface scattering, dry skin, fuzzy skin",, diff --git a/prompts/styles.csv b/prompts/styles.csv index 1c086cb..efe04c5 100644 --- a/prompts/styles.csv +++ b/prompts/styles.csv @@ -1,3 +1,3 @@ -name,positive,negative -Futuristic,"futuristic style {prompt}, sleek, modern, high tech","ugly, deformed, noisy, blurry" -Fantasy,"fantasy {prompt}, magical, vibrant","muddy, poorly lit, low detail" \ No newline at end of file +name,positive,negative,note +Futuristic,"futuristic style {prompt}, sleek, modern, high tech","ugly, deformed, noisy, blurry",test1 +Fantasy,"fantasy {prompt}, magical, vibrant","muddy, poorly lit, low detail",test2 diff --git a/web/resolution_machine.js b/web/resolution_machine.js new file mode 100644 index 0000000..5a511e7 --- /dev/null +++ b/web/resolution_machine.js @@ -0,0 +1,37 @@ +import { app } from "../../scripts/app.js"; + +app.registerExtension({ + name: "ResolutionMachine", + async nodeCreated(node) { + if (node.comfyClass !== "Resolution_Machine") return; + + console.log("ResolutionMachine nodeCreated widgets:", node.widgets); + + const resWidget = node.widgets.find(w => w.name === "resolution"); + const widthWidget = node.widgets.find(w => w.name === "width"); + const heightWidget = node.widgets.find(w => w.name === "height"); + + if (!resWidget || !widthWidget || !heightWidget) { + console.error("ResolutionMachine: missing widget(s)"); + return; + } + + // Hook resolution dropdown change + const origCallback = resWidget.callback; + resWidget.callback = function(value) { + if (origCallback) origCallback(value); + + if (value !== "Custom") { + try { + const [w, h] = value.split("x").map(v => parseInt(v)); + widthWidget.value = w; + heightWidget.value = h; + if (widthWidget.inputEl) widthWidget.inputEl.value = w; + if (heightWidget.inputEl) heightWidget.inputEl.value = h; + } catch (e) { + console.warn("ResolutionMachine: parse error", e); + } + } + }; + } +});