diff --git a/fooocus_version.py b/fooocus_version.py index 01507285..673a4aec 100644 --- a/fooocus_version.py +++ b/fooocus_version.py @@ -1 +1 @@ -version = '2.1.720' +version = '2.1.721' diff --git a/language/en.json b/language/en.json new file mode 100644 index 00000000..ed25165a --- /dev/null +++ b/language/en.json @@ -0,0 +1,370 @@ +{ + "Preview": "Preview", + "Gallery": "Gallery", + "Generate": "Generate", + "Skip": "Skip", + "Stop": "Stop", + "Input Image": "Input Image", + "Advanced": "Advanced", + "Drag above image to here": "Drag above image to here", + "Upscale or Variation:": "Upscale or Variation:", + "Disabled": "Disabled", + "Vary (Subtle)": "Vary (Subtle)", + "Vary (Strong)": "Vary (Strong)", + "Upscale (1.5x)": "Upscale (1.5x)", + "Upscale (2x)": "Upscale (2x)", + "Upscale (Fast 2x)": "Upscale (Fast 2x)", + "Image": "Image", + "Stop At": "Stop At", + "Weight": "Weight", + "Type": "Type", + "Image Prompt": "Image Prompt", + "PyraCanny": "PyraCanny", + "CPDS": "CPDS", + "Outpaint": "Outpaint", + "Left": "Left", + "Right": "Right", + "Top": "Top", + "Bottom": "Bottom", + "Performance": "Performance", + "Speed": "Speed", + "Quality": "Quality", + "Aspect Ratios": "Aspect Ratios", + "width \u00d7 height": "width \u00d7 height", + "704\u00d71408": "704\u00d71408", + "704\u00d71344": "704\u00d71344", + "768\u00d71344": "768\u00d71344", + "768\u00d71280": "768\u00d71280", + "832\u00d71216": "832\u00d71216", + "832\u00d71152": "832\u00d71152", + "896\u00d71152": "896\u00d71152", + "896\u00d71088": "896\u00d71088", + "960\u00d71088": "960\u00d71088", + "960\u00d71024": "960\u00d71024", + "1024\u00d71024": "1024\u00d71024", + "1024\u00d7960": "1024\u00d7960", + "1088\u00d7960": "1088\u00d7960", + "1088\u00d7896": "1088\u00d7896", + "1152\u00d7896": "1152\u00d7896", + "1152\u00d7832": "1152\u00d7832", + "1216\u00d7832": "1216\u00d7832", + "1280\u00d7768": "1280\u00d7768", + "1344\u00d7768": "1344\u00d7768", + "1344\u00d7704": "1344\u00d7704", + "1408\u00d7704": "1408\u00d7704", + "1472\u00d7704": "1472\u00d7704", + "1536\u00d7640": "1536\u00d7640", + "1600\u00d7640": "1600\u00d7640", + "1664\u00d7576": "1664\u00d7576", + "1728\u00d7576": "1728\u00d7576", + "Image Number": "Image Number", + "Negative Prompt": "Negative Prompt", + "Describing what you do not want to see.": "Describing what you do not want to see.", + "Random": "Random", + "Seed": "Seed", + "Image Style": "Image Style", + "Fooocus V2": "Fooocus V2", + "Default (Slightly Cinematic)": "Default (Slightly Cinematic)", + "Fooocus Masterpiece": "Fooocus Masterpiece", + "Fooocus Photograph": "Fooocus Photograph", + "Fooocus Negative": "Fooocus Negative", + "SAI 3D Model": "SAI 3D Model", + "SAI Analog Film": "SAI Analog Film", + "SAI Anime": "SAI Anime", + "SAI Cinematic": "SAI Cinematic", + "SAI Comic Book": "SAI Comic Book", + "SAI Craft Clay": "SAI Craft Clay", + "SAI Digital Art": "SAI Digital Art", + "SAI Enhance": "SAI Enhance", + "SAI Fantasy Art": "SAI Fantasy Art", + "SAI Isometric": "SAI Isometric", + "SAI Line Art": "SAI Line Art", + "SAI Lowpoly": "SAI Lowpoly", + "SAI Neonpunk": "SAI Neonpunk", + "SAI Origami": "SAI Origami", + "SAI Photographic": "SAI Photographic", + "SAI Pixel Art": "SAI Pixel Art", + "SAI Texture": "SAI Texture", + "MRE Cinematic Dynamic": "MRE Cinematic Dynamic", + "MRE Spontaneous Picture": "MRE Spontaneous Picture", + "MRE Artistic Vision": "MRE Artistic Vision", + "MRE Dark Dream": "MRE Dark Dream", + "MRE Gloomy Art": "MRE Gloomy Art", + "MRE Bad Dream": "MRE Bad Dream", + "MRE Underground": "MRE Underground", + "MRE Surreal Painting": "MRE Surreal Painting", + "MRE Dynamic Illustration": "MRE Dynamic Illustration", + "MRE Undead Art": "MRE Undead Art", + "MRE Elemental Art": "MRE Elemental Art", + "MRE Space Art": "MRE Space Art", + "MRE Ancient Illustration": "MRE Ancient Illustration", + "MRE Brave Art": "MRE Brave Art", + "MRE Heroic Fantasy": "MRE Heroic Fantasy", + "MRE Dark Cyberpunk": "MRE Dark Cyberpunk", + "MRE Lyrical Geometry": "MRE Lyrical Geometry", + "MRE Sumi E Symbolic": "MRE Sumi E Symbolic", + "MRE Sumi E Detailed": "MRE Sumi E Detailed", + "MRE Manga": "MRE Manga", + "MRE Anime": "MRE Anime", + "MRE Comic": "MRE Comic", + "Ads Advertising": "Ads Advertising", + "Ads Automotive": "Ads Automotive", + "Ads Corporate": "Ads Corporate", + "Ads Fashion Editorial": "Ads Fashion Editorial", + "Ads Food Photography": "Ads Food Photography", + "Ads Gourmet Food Photography": "Ads Gourmet Food Photography", + "Ads Luxury": "Ads Luxury", + "Ads Real Estate": "Ads Real Estate", + "Ads Retail": "Ads Retail", + "Artstyle Abstract": "Artstyle Abstract", + "Artstyle Abstract Expressionism": "Artstyle Abstract Expressionism", + "Artstyle Art Deco": "Artstyle Art Deco", + "Artstyle Art Nouveau": "Artstyle Art Nouveau", + "Artstyle Constructivist": "Artstyle Constructivist", + "Artstyle Cubist": "Artstyle Cubist", + "Artstyle Expressionist": "Artstyle Expressionist", + "Artstyle Graffiti": "Artstyle Graffiti", + "Artstyle Hyperrealism": "Artstyle Hyperrealism", + "Artstyle Impressionist": "Artstyle Impressionist", + "Artstyle Pointillism": "Artstyle Pointillism", + "Artstyle Pop Art": "Artstyle Pop Art", + "Artstyle Psychedelic": "Artstyle Psychedelic", + "Artstyle Renaissance": "Artstyle Renaissance", + "Artstyle Steampunk": "Artstyle Steampunk", + "Artstyle Surrealist": "Artstyle Surrealist", + "Artstyle Typography": "Artstyle Typography", + "Artstyle Watercolor": "Artstyle Watercolor", + "Futuristic Biomechanical": "Futuristic Biomechanical", + "Futuristic Biomechanical Cyberpunk": "Futuristic Biomechanical Cyberpunk", + "Futuristic Cybernetic": "Futuristic Cybernetic", + "Futuristic Cybernetic Robot": "Futuristic Cybernetic Robot", + "Futuristic Cyberpunk Cityscape": "Futuristic Cyberpunk Cityscape", + "Futuristic Futuristic": "Futuristic Futuristic", + "Futuristic Retro Cyberpunk": "Futuristic Retro Cyberpunk", + "Futuristic Retro Futurism": "Futuristic Retro Futurism", + "Futuristic Sci Fi": "Futuristic Sci Fi", + "Futuristic Vaporwave": "Futuristic Vaporwave", + "Game Bubble Bobble": "Game Bubble Bobble", + "Game Cyberpunk Game": "Game Cyberpunk Game", + "Game Fighting Game": "Game Fighting Game", + "Game Gta": "Game Gta", + "Game Mario": "Game Mario", + "Game Minecraft": "Game Minecraft", + "Game Pokemon": "Game Pokemon", + "Game Retro Arcade": "Game Retro Arcade", + "Game Retro Game": "Game Retro Game", + "Game Rpg Fantasy Game": "Game Rpg Fantasy Game", + "Game Strategy Game": "Game Strategy Game", + "Game Streetfighter": "Game Streetfighter", + "Game Zelda": "Game Zelda", + "Misc Architectural": "Misc Architectural", + "Misc Disco": "Misc Disco", + "Misc Dreamscape": "Misc Dreamscape", + "Misc Dystopian": "Misc Dystopian", + "Misc Fairy Tale": "Misc Fairy Tale", + "Misc Gothic": "Misc Gothic", + "Misc Grunge": "Misc Grunge", + "Misc Horror": "Misc Horror", + "Misc Kawaii": "Misc Kawaii", + "Misc Lovecraftian": "Misc Lovecraftian", + "Misc Macabre": "Misc Macabre", + "Misc Manga": "Misc Manga", + "Misc Metropolis": "Misc Metropolis", + "Misc Minimalist": "Misc Minimalist", + "Misc Monochrome": "Misc Monochrome", + "Misc Nautical": "Misc Nautical", + "Misc Space": "Misc Space", + "Misc Stained Glass": "Misc Stained Glass", + "Misc Techwear Fashion": "Misc Techwear Fashion", + "Misc Tribal": "Misc Tribal", + "Misc Zentangle": "Misc Zentangle", + "Papercraft Collage": "Papercraft Collage", + "Papercraft Flat Papercut": "Papercraft Flat Papercut", + "Papercraft Kirigami": "Papercraft Kirigami", + "Papercraft Paper Mache": "Papercraft Paper Mache", + "Papercraft Paper Quilling": "Papercraft Paper Quilling", + "Papercraft Papercut Collage": "Papercraft Papercut Collage", + "Papercraft Papercut Shadow Box": "Papercraft Papercut Shadow Box", + "Papercraft Stacked Papercut": "Papercraft Stacked Papercut", + "Papercraft Thick Layered Papercut": "Papercraft Thick Layered Papercut", + "Photo Alien": "Photo Alien", + "Photo Film Noir": "Photo Film Noir", + "Photo Glamour": "Photo Glamour", + "Photo Hdr": "Photo Hdr", + "Photo Iphone Photographic": "Photo Iphone Photographic", + "Photo Long Exposure": "Photo Long Exposure", + "Photo Neon Noir": "Photo Neon Noir", + "Photo Silhouette": "Photo Silhouette", + "Photo Tilt Shift": "Photo Tilt Shift", + "Cinematic Diva": "Cinematic Diva", + "Abstract Expressionism": "Abstract Expressionism", + "Academia": "Academia", + "Action Figure": "Action Figure", + "Adorable 3D Character": "Adorable 3D Character", + "Adorable Kawaii": "Adorable Kawaii", + "Art Deco": "Art Deco", + "Art Nouveau": "Art Nouveau", + "Astral Aura": "Astral Aura", + "Avant Garde": "Avant Garde", + "Baroque": "Baroque", + "Bauhaus Style Poster": "Bauhaus Style Poster", + "Blueprint Schematic Drawing": "Blueprint Schematic Drawing", + "Caricature": "Caricature", + "Cel Shaded Art": "Cel Shaded Art", + "Character Design Sheet": "Character Design Sheet", + "Classicism Art": "Classicism Art", + "Color Field Painting": "Color Field Painting", + "Colored Pencil Art": "Colored Pencil Art", + "Conceptual Art": "Conceptual Art", + "Constructivism": "Constructivism", + "Cubism": "Cubism", + "Dadaism": "Dadaism", + "Dark Fantasy": "Dark Fantasy", + "Dark Moody Atmosphere": "Dark Moody Atmosphere", + "Dmt Art Style": "Dmt Art Style", + "Doodle Art": "Doodle Art", + "Double Exposure": "Double Exposure", + "Dripping Paint Splatter Art": "Dripping Paint Splatter Art", + "Expressionism": "Expressionism", + "Faded Polaroid Photo": "Faded Polaroid Photo", + "Fauvism": "Fauvism", + "Flat 2d Art": "Flat 2d Art", + "Fortnite Art Style": "Fortnite Art Style", + "Futurism": "Futurism", + "Glitchcore": "Glitchcore", + "Glo Fi": "Glo Fi", + "Googie Art Style": "Googie Art Style", + "Graffiti Art": "Graffiti Art", + "Harlem Renaissance Art": "Harlem Renaissance Art", + "High Fashion": "High Fashion", + "Idyllic": "Idyllic", + "Impressionism": "Impressionism", + "Infographic Drawing": "Infographic Drawing", + "Ink Dripping Drawing": "Ink Dripping Drawing", + "Japanese Ink Drawing": "Japanese Ink Drawing", + "Knolling Photography": "Knolling Photography", + "Light Cheery Atmosphere": "Light Cheery Atmosphere", + "Logo Design": "Logo Design", + "Luxurious Elegance": "Luxurious Elegance", + "Macro Photography": "Macro Photography", + "Mandola Art": "Mandola Art", + "Marker Drawing": "Marker Drawing", + "Medievalism": "Medievalism", + "Minimalism": "Minimalism", + "Neo Baroque": "Neo Baroque", + "Neo Byzantine": "Neo Byzantine", + "Neo Futurism": "Neo Futurism", + "Neo Impressionism": "Neo Impressionism", + "Neo Rococo": "Neo Rococo", + "Neoclassicism": "Neoclassicism", + "Op Art": "Op Art", + "Ornate And Intricate": "Ornate And Intricate", + "Pencil Sketch Drawing": "Pencil Sketch Drawing", + "Pop Art 2": "Pop Art 2", + "Rococo": "Rococo", + "Silhouette Art": "Silhouette Art", + "Simple Vector Art": "Simple Vector Art", + "Sketchup": "Sketchup", + "Steampunk 2": "Steampunk 2", + "Surrealism": "Surrealism", + "Suprematism": "Suprematism", + "Terragen": "Terragen", + "Tranquil Relaxing Atmosphere": "Tranquil Relaxing Atmosphere", + "Sticker Designs": "Sticker Designs", + "Vibrant Rim Light": "Vibrant Rim Light", + "Volumetric Lighting": "Volumetric Lighting", + "Watercolor 2": "Watercolor 2", + "Whimsical And Playful": "Whimsical And Playful", + "Base Model (SDXL only)": "Base Model (SDXL only)", + "bluePencilXL_v009.safetensors": "bluePencilXL_v009.safetensors", + "bluePencilXL_v050.safetensors": "bluePencilXL_v050.safetensors", + "DreamShaper_8_pruned.safetensors": "DreamShaper_8_pruned.safetensors", + "realisticStockPhoto_v10.safetensors": "realisticStockPhoto_v10.safetensors", + "realisticVisionV51_v51VAE.safetensors": "realisticVisionV51_v51VAE.safetensors", + "sd_xl_base_1.0_0.9vae.safetensors": "sd_xl_base_1.0_0.9vae.safetensors", + "sd_xl_refiner_1.0_0.9vae.safetensors": "sd_xl_refiner_1.0_0.9vae.safetensors", + "Refiner (SDXL or SD 1.5)": "Refiner (SDXL or SD 1.5)", + "None": "None", + "SDXL LoRA 1": "SDXL LoRA 1", + "3d_render_style_xl.safetensors": "3d_render_style_xl.safetensors", + "Bloodstained-XL-V1.safetensors": "Bloodstained-XL-V1.safetensors", + "SDXL_FILM_PHOTOGRAPHY_STYLE_BetaV0.4.safetensors": "SDXL_FILM_PHOTOGRAPHY_STYLE_BetaV0.4.safetensors", + "sd_xl_offset_example-lora_1.0.safetensors": "sd_xl_offset_example-lora_1.0.safetensors", + "SDXL LoRA 2": "SDXL LoRA 2", + "SDXL LoRA 3": "SDXL LoRA 3", + "SDXL LoRA 4": "SDXL LoRA 4", + "SDXL LoRA 5": "SDXL LoRA 5", + "Refresh": "Refresh", + "Sampling Sharpness": "Sampling Sharpness", + "Higher value means image and texture are sharper.": "Higher value means image and texture are sharper.", + "Guidance Scale": "Guidance Scale", + "Higher value means style is cleaner, vivider, and more artistic.": "Higher value means style is cleaner, vivider, and more artistic.", + "Developer Debug Mode": "Developer Debug Mode", + "Positive ADM Guidance Scaler": "Positive ADM Guidance Scaler", + "The scaler multiplied to positive ADM (use 1.0 to disable). ": "The scaler multiplied to positive ADM (use 1.0 to disable). ", + "Negative ADM Guidance Scaler": "Negative ADM Guidance Scaler", + "The scaler multiplied to negative ADM (use 1.0 to disable). ": "The scaler multiplied to negative ADM (use 1.0 to disable). ", + "ADM Guidance End At Step": "ADM Guidance End At Step", + "When to end the guidance from positive/negative ADM. ": "When to end the guidance from positive/negative ADM. ", + "Refiner swap method": "Refiner swap method", + "joint": "joint", + "separate": "separate", + "vae": "vae", + "CFG Mimicking from TSNR": "CFG Mimicking from TSNR", + "Enabling Fooocus's implementation of CFG mimicking for TSNR (effective when real CFG > mimicked CFG).": "Enabling Fooocus's implementation of CFG mimicking for TSNR (effective when real CFG > mimicked CFG).", + "Sampler": "Sampler", + "Only effective in non-inpaint mode.": "Only effective in non-inpaint mode.", + "euler": "euler", + "euler_ancestral": "euler_ancestral", + "heun": "heun", + "dpm_2": "dpm_2", + "dpm_2_ancestral": "dpm_2_ancestral", + "lms": "lms", + "dpm_fast": "dpm_fast", + "dpm_adaptive": "dpm_adaptive", + "dpmpp_2s_ancestral": "dpmpp_2s_ancestral", + "dpmpp_sde": "dpmpp_sde", + "dpmpp_sde_gpu": "dpmpp_sde_gpu", + "dpmpp_2m": "dpmpp_2m", + "dpmpp_2m_sde": "dpmpp_2m_sde", + "dpmpp_2m_sde_gpu": "dpmpp_2m_sde_gpu", + "dpmpp_3m_sde": "dpmpp_3m_sde", + "dpmpp_3m_sde_gpu": "dpmpp_3m_sde_gpu", + "ddpm": "ddpm", + "ddim": "ddim", + "uni_pc": "uni_pc", + "uni_pc_bh2": "uni_pc_bh2", + "Scheduler": "Scheduler", + "Scheduler of Sampler.": "Scheduler of Sampler.", + "normal": "normal", + "karras": "karras", + "exponential": "exponential", + "sgm_uniform": "sgm_uniform", + "simple": "simple", + "ddim_uniform": "ddim_uniform", + "Forced Overwrite of Sampling Step": "Forced Overwrite of Sampling Step", + "Set as -1 to disable. For developer debugging.": "Set as -1 to disable. For developer debugging.", + "Forced Overwrite of Refiner Switch Step": "Forced Overwrite of Refiner Switch Step", + "Forced Overwrite of Generating Width": "Forced Overwrite of Generating Width", + "Set as -1 to disable. For developer debugging. Results will be worse for non-standard numbers that SDXL is not trained on.": "Set as -1 to disable. For developer debugging. Results will be worse for non-standard numbers that SDXL is not trained on.", + "Forced Overwrite of Generating Height": "Forced Overwrite of Generating Height", + "Forced Overwrite of Denoising Strength of \"Vary\"": "Forced Overwrite of Denoising Strength of \"Vary\"", + "Set as negative number to disable. For developer debugging.": "Set as negative number to disable. For developer debugging.", + "Forced Overwrite of Denoising Strength of \"Upscale\"": "Forced Overwrite of Denoising Strength of \"Upscale\"", + "Inpaint Engine": "Inpaint Engine", + "Version of Fooocus inpaint model": "Version of Fooocus inpaint model", + "v1": "v1", + "v2.5": "v2.5", + "Debug Preprocessors": "Debug Preprocessors", + "Mixing Image Prompt and Vary/Upscale": "Mixing Image Prompt and Vary/Upscale", + "Mixing Image Prompt and Inpaint": "Mixing Image Prompt and Inpaint", + "Softness of ControlNet": "Softness of ControlNet", + "Similar to the Control Mode in A1111 (use 0.0 to disable). ": "Similar to the Control Mode in A1111 (use 0.0 to disable). ", + "Canny Low Threshold": "Canny Low Threshold", + "Canny High Threshold": "Canny High Threshold", + "Enabled": "Enabled", + "B1": "B1", + "B2": "B2", + "S1": "S1", + "S2": "S2" +} \ No newline at end of file diff --git a/modules/gradio_hijack.py b/modules/gradio_hijack.py index 9808f5da..90149ad5 100644 --- a/modules/gradio_hijack.py +++ b/modules/gradio_hijack.py @@ -446,3 +446,18 @@ class Image( ): # If an externally hosted image, don't convert to absolute path return input_data return str(utils.abspath(input_data)) + + +all_components = [] + +if not hasattr(IOComponent, 'original__init__'): + IOComponent.original_init = IOComponent.__init__ + + +def ioc_ini(self, *args, **kwargs): + all_components.append(self) + return IOComponent.original_init(self, *args, **kwargs) + + +IOComponent.__init__ = ioc_ini + diff --git a/modules/localization.py b/modules/localization.py index 4bc56265..412802a7 100644 --- a/modules/localization.py +++ b/modules/localization.py @@ -23,3 +23,35 @@ def localization_js(filename): print(f'Failed to load localization file {full_name}') return f"window.localization = {json.dumps(data)}" + + +def dump_english_config(components): + all_texts = [] + for c in components: + label = getattr(c, 'label', None) + # value = getattr(c, 'value', None) + choices = getattr(c, 'choices', None) + info = getattr(c, 'info', None) + + if isinstance(label, str): + all_texts.append(label) + # if isinstance(value, str): + # all_texts.append(value) + if isinstance(info, str): + all_texts.append(info) + if isinstance(choices, list): + for x in choices: + if isinstance(x, str): + all_texts.append(x) + if isinstance(x, tuple): + for y in x: + if isinstance(y, str): + all_texts.append(y) + + config_dict = {k: k for k in all_texts} + full_name = os.path.abspath(os.path.join(localization_root, 'en.json')) + + with open(full_name, "w", encoding="utf-8") as json_file: + json.dump(config_dict, json_file, indent=4) + + return diff --git a/update_log.md b/update_log.md index bd8bb20e..6656cf1e 100644 --- a/update_log.md +++ b/update_log.md @@ -1,3 +1,7 @@ +# 2.1.721 + +* Added language/en.json to make translation easier. + # 2.1.720 * Added Canvas Zoom to inpaint canvas diff --git a/webui.py b/webui.py index 192bc9bd..c8c6bc4e 100644 --- a/webui.py +++ b/webui.py @@ -358,6 +358,13 @@ with shared.gradio_root: break +def dump_default_english_config(): + from modules.localization import dump_english_config + dump_english_config(grh.all_components) + + +# dump_default_english_config() + shared.gradio_root.launch( inbrowser=args_manager.args.auto_launch, server_name=args_manager.args.listen,