update
This commit is contained in:
+27
-71
@@ -7,9 +7,6 @@ class Resolution_Machine:
|
||||
|
||||
@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": [
|
||||
{
|
||||
@@ -29,7 +26,7 @@ class Resolution_Machine:
|
||||
"model": "SDXL",
|
||||
"resolutions": [
|
||||
{ "name": "Square (1:1 native)", "width": 1024, "height": 1024 },
|
||||
{ "name": "Portrait (2:3)", "width": 832, "height": 1248 },
|
||||
{ "name": "Portrait (2:3)", "width": 832, "height": 1216 },
|
||||
{ "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 },
|
||||
@@ -44,24 +41,12 @@ class Resolution_Machine:
|
||||
]
|
||||
},
|
||||
{
|
||||
"model": "Illustrious XL v1.0",
|
||||
"model": "Illustrious XL",
|
||||
"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 example", "width": 1024, "height": 1024 },
|
||||
{ "name": "Standard high-res", "width": 1536, "height": 1536 },
|
||||
{ "name": "Maximum native", "width": 2048, "height": 2048 }
|
||||
]
|
||||
},
|
||||
{
|
||||
"model": "Pony XL",
|
||||
"resolutions": [
|
||||
{ "name": "Maximum native", "width": 2048, "height": 2048 },
|
||||
{ "name": "Portrait-tall", "width": 832, "height": 1216 },
|
||||
{ "name": "Landscape-wide", "width": 1216, "height": 832 },
|
||||
{ "name": "Square (1:1)", "width": 1024, "height": 1024 }
|
||||
@@ -104,17 +89,11 @@ class Resolution_Machine:
|
||||
{ "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)
|
||||
# Append Custom option idempotently
|
||||
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})
|
||||
@@ -123,57 +102,38 @@ class Resolution_Machine:
|
||||
|
||||
@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.
|
||||
"""Expose model list and a default resolution list (for the default model).
|
||||
Frontend will dynamically set the resolution options for other models using the REST API.
|
||||
"""
|
||||
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
|
||||
|
||||
# Use default_model resolutions so widget is created at instantiation
|
||||
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]
|
||||
resolutions = [r["name"] for r in model_obj.get("resolutions", [])]
|
||||
else:
|
||||
resolutions = ["Custom (manual)"]
|
||||
|
||||
# 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"]
|
||||
# pick a default resolution that's non-custom if possible
|
||||
default_res = next((n for n in resolutions if n != "Custom (manual)"), resolutions[0])
|
||||
|
||||
# determine defaults for width/height from default_res
|
||||
default_w = 512
|
||||
default_h = 512
|
||||
if model_obj:
|
||||
r_obj = next((r for r in model_obj["resolutions"] if r["name"] == default_res), None)
|
||||
if r_obj:
|
||||
default_w = r_obj["width"]
|
||||
default_h = r_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}),
|
||||
"resolution": (resolutions if resolutions else ["Custom (manual)"], {"default": default_res}),
|
||||
"width": ("INT", {"default": default_w, "min": 1, "max": 16384, "step": 1}),
|
||||
"height": ("INT", {"default": default_h, "min": 1, "max": 16384, "step": 1}),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -182,20 +142,16 @@ class Resolution_Machine:
|
||||
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)
|
||||
# REST endpoint for frontend dynamic updates
|
||||
@PromptServer.instance.routes.get("/sata/resolution_machine/config")
|
||||
async def get_resolution_config(request):
|
||||
return web.json_response(Resolution_Machine._get_config())
|
||||
@@ -0,0 +1,14 @@
|
||||
name,positive,negative,note
|
||||
"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",
|
||||
|
@@ -0,0 +1,2 @@
|
||||
name,positive,negative,note
|
||||
Chibi,"full body, chibi, highly detailed","photo, black and white, low contrast",chibi_blindbox_v1_mix
|
||||
|
@@ -0,0 +1,6 @@
|
||||
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
|
||||
ilustmix,"masterpiece, best quality, amazing quality, very aesthetic, detailed eyes, perfect eyes, realistic eyes",,Sampler: Euler a Steps: 25
|
||||
WAI,masterpiece,,Steps: 15-30 CFG scale: 5-7 Sampler: Euler a
|
||||
|
@@ -1,74 +1,8 @@
|
||||
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",,
|
||||
|
||||
|
+35
-2
@@ -1,3 +1,36 @@
|
||||
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
|
||||
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",
|
||||
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",,
|
||||
|
||||
|
+193
-31
@@ -1,37 +1,199 @@
|
||||
import { app } from "../../scripts/app.js";
|
||||
// resolution_machine.js
|
||||
import { app } from "../../../scripts/app.js";
|
||||
|
||||
async function fetchConfig() {
|
||||
try {
|
||||
const resp = await fetch("/sata/resolution_machine/config");
|
||||
if (!resp.ok) {
|
||||
console.warn("ResolutionMachine: fetch failed", resp.status);
|
||||
return null;
|
||||
}
|
||||
const json = await resp.json();
|
||||
return json;
|
||||
} catch (e) {
|
||||
console.warn("ResolutionMachine: fetch exception", e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/* cross-version widget helpers */
|
||||
function setComboOptions(widget, options) {
|
||||
if (!widget) return;
|
||||
if (typeof widget.setOptions === "function") {
|
||||
widget.setOptions(options);
|
||||
return;
|
||||
}
|
||||
if (widget.options && Object.prototype.hasOwnProperty.call(widget.options, "values")) {
|
||||
widget.options.values = options;
|
||||
return;
|
||||
}
|
||||
widget.options = { values: options };
|
||||
}
|
||||
function setWidgetValue(widget, v) {
|
||||
if (!widget) return;
|
||||
if (typeof widget.setValue === "function") return widget.setValue(v);
|
||||
if (typeof widget.value === "function") return widget.value(v);
|
||||
widget.value = v;
|
||||
}
|
||||
function getWidgetValue(widget) {
|
||||
if (!widget) return undefined;
|
||||
if (typeof widget.value === "function") return widget.value();
|
||||
return widget.value;
|
||||
}
|
||||
function triggerWidgetChange(widget, value) {
|
||||
// call onChange or callback if present to simulate user selection
|
||||
if (!widget) return;
|
||||
if (typeof widget.onChange === "function") {
|
||||
try { widget.onChange(value); return; } catch (e) { /* continue */ }
|
||||
}
|
||||
if (typeof widget.callback === "function") {
|
||||
try { widget.callback(value); return; } catch (e) { /* continue */ }
|
||||
}
|
||||
// fallback: set value
|
||||
setWidgetValue(widget, value);
|
||||
}
|
||||
|
||||
/* attach handler in tolerant way */
|
||||
function attachHandler(widget, node, handler) {
|
||||
if (!widget) return;
|
||||
if (typeof widget.onChange === "function") {
|
||||
widget.onChange(handler);
|
||||
return;
|
||||
}
|
||||
// preserve existing callback if present
|
||||
const orig = widget.callback;
|
||||
widget.callback = function (v) {
|
||||
try { if (orig) orig.call(node, v); } catch (e) { /* ignore */ }
|
||||
try { handler(v); } catch (e) { console.warn("handler error", e); }
|
||||
};
|
||||
}
|
||||
|
||||
app.registerExtension({
|
||||
name: "ResolutionMachine",
|
||||
async nodeCreated(node) {
|
||||
if (node.comfyClass !== "Resolution_Machine") return;
|
||||
name: "SATA_UtilityNode.ResolutionMachine",
|
||||
async nodeCreated(node) {
|
||||
if (node.comfyClass !== "Resolution_Machine") return;
|
||||
|
||||
console.log("ResolutionMachine nodeCreated widgets:", node.widgets);
|
||||
const modelW = node.widgets.find(w => w.name === "model");
|
||||
const resW = node.widgets.find(w => w.name === "resolution");
|
||||
const wW = node.widgets.find(w => w.name === "width");
|
||||
const hW = node.widgets.find(w => w.name === "height");
|
||||
|
||||
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");
|
||||
console.log("ResolutionMachine nodeCreated widgets:", { modelW, resW, wW, hW });
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
};
|
||||
if (!modelW || !resW || !wW || !hW) {
|
||||
console.warn("ResolutionMachine: missing widgets - ensure backend's INPUT_TYPES exposes model,resolution,width,height");
|
||||
return;
|
||||
}
|
||||
});
|
||||
|
||||
const cfg = await fetchConfig();
|
||||
if (!cfg) {
|
||||
console.warn("ResolutionMachine: no config received from backend");
|
||||
return;
|
||||
}
|
||||
|
||||
const models = cfg.models.map(m => m.model);
|
||||
if (models.length > 0) setComboOptions(modelW, models);
|
||||
|
||||
// helper to get resolution list for a model (ensures Custom present)
|
||||
function getResNamesForModel(modelName) {
|
||||
const m = cfg.models.find(x => x.model === modelName);
|
||||
if (!m) return ["Custom (manual)"];
|
||||
const names = m.resolutions.map(r => r.name.slice()); // copy
|
||||
if (!names.includes("Custom (manual)")) names.push("Custom (manual)");
|
||||
return names;
|
||||
}
|
||||
|
||||
// helper to find resolution object
|
||||
function findResObj(modelName, resName) {
|
||||
const m = cfg.models.find(x => x.model === modelName);
|
||||
if (!m) return null;
|
||||
return m.resolutions.find(r => r.name === resName) || null;
|
||||
}
|
||||
|
||||
// guard to avoid manual-edit handler firing during programmatic updates
|
||||
let suppressManualWH = false;
|
||||
function programmaticSetWH(wVal, hVal) {
|
||||
suppressManualWH = true;
|
||||
setWidgetValue(wW, wVal);
|
||||
setWidgetValue(hW, hVal);
|
||||
if (wW.inputEl) wW.inputEl.value = wVal;
|
||||
if (hW.inputEl) hW.inputEl.value = hVal;
|
||||
// clear suppression on next tick
|
||||
setTimeout(() => { suppressManualWH = false; }, 0);
|
||||
}
|
||||
|
||||
// Model change handler: update resolution options and pick first preset
|
||||
const onModelChange = (newModel) => {
|
||||
try {
|
||||
const names = getResNamesForModel(newModel);
|
||||
setComboOptions(resW, names);
|
||||
|
||||
// pick first non-custom if available
|
||||
const pick = names[0] || "Custom (manual)";
|
||||
setWidgetValue(resW, pick);
|
||||
// call resolution handler (simulate user selection)
|
||||
triggerWidgetChange(resW, pick);
|
||||
|
||||
// ensure node re-validation / UI update
|
||||
try { node.setDirtyCanvas(true, true); } catch (e) { try { node.setDirtyCanvas(true); } catch(e){} }
|
||||
} catch (e) {
|
||||
console.warn("ResolutionMachine: onModelChange error", e);
|
||||
}
|
||||
};
|
||||
|
||||
// Resolution change handler: set width/height for presets, lock/unlock inputs accordingly
|
||||
const onResolutionChange = (newRes) => {
|
||||
try {
|
||||
const modelName = getWidgetValue(modelW);
|
||||
const resObj = findResObj(modelName, newRes);
|
||||
if (resObj && newRes !== "Custom (manual)") {
|
||||
programmaticSetWH(resObj.width, resObj.height);
|
||||
// Lock width/height
|
||||
if (wW.inputEl) wW.inputEl.disabled = true;
|
||||
if (hW.inputEl) hW.inputEl.disabled = true;
|
||||
} else {
|
||||
// Custom: allow manual edits
|
||||
if (wW.inputEl) wW.inputEl.disabled = false;
|
||||
if (hW.inputEl) hW.inputEl.disabled = false;
|
||||
}
|
||||
try { node.setDirtyCanvas(true, true); } catch (e) { try { node.setDirtyCanvas(true); } catch(e){} }
|
||||
} catch (e) {
|
||||
console.warn("ResolutionMachine: onResolutionChange error", e);
|
||||
}
|
||||
};
|
||||
|
||||
// Manual width/height change handler: set resolution to Custom (manual)
|
||||
const onManualWH = (_newVal) => {
|
||||
if (suppressManualWH) return;
|
||||
try {
|
||||
const cur = getWidgetValue(resW);
|
||||
if (cur !== "Custom (manual)") {
|
||||
const names = getResNamesForModel(getWidgetValue(modelW));
|
||||
if (!names.includes("Custom (manual)")) {
|
||||
names.push("Custom (manual)");
|
||||
setComboOptions(resW, names);
|
||||
}
|
||||
setWidgetValue(resW, "Custom (manual)");
|
||||
try { triggerWidgetChange(resW, "Custom (manual)"); } catch(e){}
|
||||
try { node.setDirtyCanvas(true, true); } catch (e) { try { node.setDirtyCanvas(true); } catch(e){} }
|
||||
}
|
||||
} catch (e) {
|
||||
console.warn("ResolutionMachine: onManualWH error", e);
|
||||
}
|
||||
};
|
||||
|
||||
// Attach handlers (tolerant)
|
||||
attachHandler(modelW, node, onModelChange);
|
||||
attachHandler(resW, node, onResolutionChange);
|
||||
attachHandler(wW, node, onManualWH);
|
||||
attachHandler(hW, node, onManualWH);
|
||||
|
||||
// Initialize model + resolution UI
|
||||
const initialModel = getWidgetValue(modelW) || (models.length ? models[0] : undefined);
|
||||
if (initialModel) {
|
||||
setWidgetValue(modelW, initialModel);
|
||||
// ensure options & width/height set for initial model
|
||||
onModelChange(initialModel);
|
||||
}
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user