Compare commits
33 Commits
e5c0a42cfe
...
c7b74f60f8
| Author | SHA1 | Date |
|---|---|---|
|
|
c7b74f60f8 | |
|
|
2c78cec01d | |
|
|
ef0acca9f9 | |
|
|
60af8d2d84 | |
|
|
39d07bf0f3 | |
|
|
f0dcf5a911 | |
|
|
c4d5b160be | |
|
|
2f08cb4360 | |
|
|
da3d4d006f | |
|
|
29a29e1409 | |
|
|
a305d84572 | |
|
|
1b80354561 | |
|
|
f651837e15 | |
|
|
4e514318b5 | |
|
|
990a97c628 | |
|
|
889ad22a27 | |
|
|
c194632f52 | |
|
|
aeb53b7293 | |
|
|
f7474c0281 | |
|
|
ef18beec5d | |
|
|
fe20834566 | |
|
|
467ff398b2 | |
|
|
f0fc8335a3 | |
|
|
90123d12d9 | |
|
|
7dd3995a11 | |
|
|
ac561455b3 | |
|
|
8d51f45833 | |
|
|
fc171f4178 | |
|
|
b2c0fa41b1 | |
|
|
e4f1da6923 | |
|
|
10937fb5fe | |
|
|
e697234715 | |
|
|
b7b00e92ee |
|
|
@ -216,9 +216,9 @@ def is_url(url_or_filename):
|
|||
def load_checkpoint(model,url_or_filename):
|
||||
if is_url(url_or_filename):
|
||||
cached_file = download_cached_file(url_or_filename, check_hash=False, progress=True)
|
||||
checkpoint = torch.load(cached_file, map_location='cpu')
|
||||
checkpoint = torch.load(cached_file, map_location='cpu', weights_only=True)
|
||||
elif os.path.isfile(url_or_filename):
|
||||
checkpoint = torch.load(url_or_filename, map_location='cpu')
|
||||
checkpoint = torch.load(url_or_filename, map_location='cpu', weights_only=True)
|
||||
else:
|
||||
raise RuntimeError('checkpoint url or path is invalid')
|
||||
|
||||
|
|
|
|||
|
|
@ -78,9 +78,9 @@ def blip_nlvr(pretrained='',**kwargs):
|
|||
def load_checkpoint(model,url_or_filename):
|
||||
if is_url(url_or_filename):
|
||||
cached_file = download_cached_file(url_or_filename, check_hash=False, progress=True)
|
||||
checkpoint = torch.load(cached_file, map_location='cpu')
|
||||
checkpoint = torch.load(cached_file, map_location='cpu', weights_only=True)
|
||||
elif os.path.isfile(url_or_filename):
|
||||
checkpoint = torch.load(url_or_filename, map_location='cpu')
|
||||
checkpoint = torch.load(url_or_filename, map_location='cpu', weights_only=True)
|
||||
else:
|
||||
raise RuntimeError('checkpoint url or path is invalid')
|
||||
state_dict = checkpoint['model']
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ def init_detection_model(model_name, half=False, device='cuda', model_rootpath=N
|
|||
url=model_url, model_dir='facexlib/weights', progress=True, file_name=None, save_dir=model_rootpath)
|
||||
|
||||
# TODO: clean pretrained model
|
||||
load_net = torch.load(model_path, map_location=lambda storage, loc: storage)
|
||||
load_net = torch.load(model_path, map_location=lambda storage, loc: storage, weights_only=True)
|
||||
# remove unnecessary 'module.'
|
||||
for k, v in deepcopy(load_net).items():
|
||||
if k.startswith('module.'):
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ def init_parsing_model(model_name='bisenet', half=False, device='cuda', model_ro
|
|||
|
||||
model_path = load_file_from_url(
|
||||
url=model_url, model_dir='facexlib/weights', progress=True, file_name=None, save_dir=model_rootpath)
|
||||
load_net = torch.load(model_path, map_location=lambda storage, loc: storage)
|
||||
load_net = torch.load(model_path, map_location=lambda storage, loc: storage, weights_only=True)
|
||||
model.load_state_dict(load_net, strict=True)
|
||||
model.eval()
|
||||
model = model.to(device)
|
||||
|
|
|
|||
|
|
@ -104,7 +104,7 @@ def load_ip_adapter(clip_vision_path, ip_negative_path, ip_adapter_path):
|
|||
offload_device = torch.device('cpu')
|
||||
|
||||
use_fp16 = model_management.should_use_fp16(device=load_device)
|
||||
ip_state_dict = torch.load(ip_adapter_path, map_location="cpu")
|
||||
ip_state_dict = torch.load(ip_adapter_path, map_location="cpu", weights_only=True)
|
||||
plus = "latents" in ip_state_dict["image_proj"]
|
||||
cross_attention_dim = ip_state_dict["ip_adapter"]["1.to_k_ip.weight"].shape[1]
|
||||
sdxl = cross_attention_dim == 2048
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
version = '2.5.2'
|
||||
version = '2.5.3'
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@
|
|||
"Content Type": "Content Type",
|
||||
"Photograph": "Photograph",
|
||||
"Art/Anime": "Art/Anime",
|
||||
"Apply Styles": "Apply Styles",
|
||||
"Describe this Image into Prompt": "Describe this Image into Prompt",
|
||||
"Image Size and Recommended Size": "Image Size and Recommended Size",
|
||||
"Upscale or Variation:": "Upscale or Variation:",
|
||||
|
|
|
|||
|
|
@ -0,0 +1,470 @@
|
|||
{
|
||||
"Preview": "Предпросмотр",
|
||||
"Gallery": "Галерея",
|
||||
"Generate": "Сгенерировать",
|
||||
"Skip": "Пропустить",
|
||||
"Stop": "Остановить",
|
||||
"Load Parameters": "Загрузить Параметры",
|
||||
"Type prompt here or paste parameters.": "Введите запрос или вставьте параметры здесь",
|
||||
"Input Image": "Добавить изображение",
|
||||
"Advanced": "Расширенные настройки",
|
||||
"Upscale or Variation": "Увеличить или Изменить",
|
||||
"Image Prompt": "Подсказка к изображению",
|
||||
"Inpaint or Outpaint (beta)": "Дорисовать или Расширить (beta)",
|
||||
"Drag above image to here": "Перетащите изображение сюда",
|
||||
"Upscale or Variation:": "Увеличение или Изменение:",
|
||||
"Disabled": "Выключенный",
|
||||
"Vary (Subtle)": "Изменить (Незначительно)",
|
||||
"Vary (Strong)": "Изменить (Сильно)",
|
||||
"Upscale (1.5x)": "Увеличить (1.5x)",
|
||||
"Upscale (2x)": "Увеличить (2x)",
|
||||
"Upscale (Fast 2x)": "Увеличить (Быстро 2x)",
|
||||
"\ud83d\udcd4 Document": "\uD83D\uDCD4 Справка",
|
||||
"Image": "Изображение",
|
||||
"Stop At": "Остановить на",
|
||||
"Weight": "Вес",
|
||||
"Type": "Тип",
|
||||
"PyraCanny": "Контуры",
|
||||
"CPDS": "Глубина",
|
||||
"FaceSwap": "Лицо",
|
||||
"ImagePrompt": "Стиль",
|
||||
"* \"Image Prompt\" is powered by Fooocus Image Mixture Engine (v1.0.1).": "* \"Подсказка к изображению\" работает на движке Fooocus Image Mixture Engine (v1.0.1).",
|
||||
"The scaler multiplied to positive ADM (use 1.0 to disable).": "Масштабное умножение на положительное ADM (1.0 для отключения).",
|
||||
"The scaler multiplied to negative ADM (use 1.0 to disable).": "Масштаб, умноженный на отрицательное значение ADM (1.0 для отключения).",
|
||||
"When to end the guidance from positive/negative ADM.": "Когда заканчивать обработку позитива/негатива ADM.",
|
||||
"Similar to the Control Mode in A1111 (use 0.0 to disable).": "То же что и Control Mode в A1111 (0.0 для отключения).",
|
||||
"Inpaint or Outpaint": "Inpaint или Outpaint",
|
||||
"Drag Inpaint or Outpaint image to hear": "Добавьте изображение чтобы Изменить/Дорисовать его ",
|
||||
"Outpaint Expansion (": "Outpaint Expansion (",
|
||||
"Method": "Метод",
|
||||
"Inpaint or Outpaint (default)": "Inpaint или Outpaint (Базовый)",
|
||||
"Improve Detail (face, hand, eyes, etc.)": "Улучшить детали (лицо, руки, глаза и т.д.)",
|
||||
"Modify Content (add objects, change background, etc.)": "Изменить содержимое (добавить объекты, изменить фон и т.д.)",
|
||||
"Inpaint Additional Prompt": "Дополнительный запрос Inpaint",
|
||||
"Outpaint": "Дорисовать",
|
||||
"Outpaint Direction": "Направление генерации Outpaint",
|
||||
"Left": "Слева",
|
||||
"Right": "Справва",
|
||||
"Top": "Сверху",
|
||||
"Bottom": "Снизу",
|
||||
"- Zoom canvas": "- Масштаб",
|
||||
"- Adjust brush size": "- Размер кисти",
|
||||
"- Undo last action": "- Отменить",
|
||||
"- Reset zoom": "- Вернуть масштаб",
|
||||
"- Fullscreen mode": "- На весь экран",
|
||||
"- Move canvas": "- Перетаскивать",
|
||||
"Setting": "Настройка",
|
||||
"Style": "Стиль",
|
||||
"Performance": "Производительность",
|
||||
"Speed": "Скорость",
|
||||
"Quality": "Качество",
|
||||
"Aspect Ratios": "Соотношения сторон",
|
||||
"width \u00d7 height": "ширина \u00d7 высота",
|
||||
"Image Number": "Кол-во изображений",
|
||||
"Negative Prompt": "Негативная подсказка",
|
||||
"Describing what you do not want to see.": "Напишите то, что вы не хотите видеть.",
|
||||
"Random": "Случайный",
|
||||
"Seed": "Исходное зерно (id)",
|
||||
"\ud83d\udcda History Log": "\ud83d\udcda История генераций",
|
||||
"Image Style": "Стиль изображения",
|
||||
"Fooocus V2": "Fooocus V2",
|
||||
"Default (Slightly Cinematic)": "Базовый (Слегка кинематографичный)",
|
||||
"Fooocus Masterpiece": "Fooocus Шедевр",
|
||||
"Fooocus Photograph": "Fooocus Фото",
|
||||
"Fooocus Negative": "Fooocus Негатив Реалистичный",
|
||||
"SAI 3D Model": "SAI 3D Модель",
|
||||
"SAI Analog Film": "SAI Аналоговый фильм",
|
||||
"SAI Anime": "SAI Аниме",
|
||||
"SAI Cinematic": "SAI Фильм",
|
||||
"SAI Comic Book": "SAI Комикс",
|
||||
"SAI Craft Clay": "SAI Глина",
|
||||
"SAI Digital Art": "SAI Цифровой Арт",
|
||||
"SAI Enhance": "SAI Дополнительный",
|
||||
"SAI Fantasy Art": "SAI Фэнтези Арт",
|
||||
"SAI Isometric": "SAI Изометрический",
|
||||
"SAI Line Art": "SAI Линейный Арт",
|
||||
"SAI Lowpoly": "SAI Низкополигональный",
|
||||
"SAI Neonpunk": "SAI Неонпанк",
|
||||
"SAI Origami": "SAI Оригами",
|
||||
"SAI Photographic": "SAI Фотография",
|
||||
"SAI Pixel Art": "SAI Пиксельный Арт",
|
||||
"SAI Texture": "SAI Текстура",
|
||||
"MRE Cinematic Dynamic": "MRE Фильм динамичный",
|
||||
"MRE Spontaneous Picture": "MRE Случайное фото",
|
||||
"MRE Artistic Vision": "MRE Шедевр",
|
||||
"MRE Dark Dream": "MRE Темный сон",
|
||||
"MRE Gloomy Art": "MRE Мрачный Арт",
|
||||
"MRE Bad Dream": "MRE Страшный сон",
|
||||
"MRE Underground": "MRE Подземный",
|
||||
"MRE Surreal Painting": "MRE Сюрреалистическая живопись",
|
||||
"MRE Dynamic Illustration": "MRE Динамическая иллюстрация",
|
||||
"MRE Undead Art": "MRE Воставший из мертвых Арт",
|
||||
"MRE Elemental Art": "MRE Элементальный Арт",
|
||||
"MRE Space Art": "MRE Космический Арт",
|
||||
"MRE Ancient Illustration": "MRE Старинная иллюстрация",
|
||||
"MRE Brave Art": "MRE Героический Арт",
|
||||
"MRE Heroic Fantasy": "MRE Героическое фентези",
|
||||
"MRE Dark Cyberpunk": "MRE Темный киберпанк",
|
||||
"MRE Lyrical Geometry": "MRE Лирическая геометрия",
|
||||
"MRE Sumi E Symbolic": "MRE Sumi E Японский символичный",
|
||||
"MRE Sumi E Detailed": "MRE Sumi E Японский детали",
|
||||
"MRE Manga": "MRE Манга",
|
||||
"MRE Anime": "MRE Аниме",
|
||||
"MRE Comic": "MRE Комикс",
|
||||
"Ads Advertising": "Ads Реклама",
|
||||
"Ads Automotive": "Ads Авто Машина",
|
||||
"Ads Corporate": "Ads Корпоративный",
|
||||
"Ads Fashion Editorial": "Ads Мода Фэшн",
|
||||
"Ads Food Photography": "Ads Фото Еда",
|
||||
"Ads Gourmet Food Photography": "Ads Фото Еда для гурманов",
|
||||
"Ads Luxury": "Ads Люкс",
|
||||
"Ads Real Estate": "Ads Недвижимость",
|
||||
"Ads Retail": "Ads Розничная торговля",
|
||||
"Artstyle Abstract": "Стиль Абстрактный",
|
||||
"Artstyle Abstract Expressionism": "Стиль Абстрактный Художественный",
|
||||
"Artstyle Art Deco": "Стиль Абстрактный Деко",
|
||||
"Artstyle Art Nouveau": "Стиль Абстрактный Модерн",
|
||||
"Artstyle Constructivist": "Стиль Конструктивизм",
|
||||
"Artstyle Cubist": "Стиль Кубизм",
|
||||
"Artstyle Expressionist": "Стиль Экспрессионизм",
|
||||
"Artstyle Graffiti": "Стиль Граффити",
|
||||
"Artstyle Hyperrealism": "Стиль Гипперреальзм",
|
||||
"Artstyle Impressionist": "Стиль Импрессионизм",
|
||||
"Artstyle Pointillism": "Стиль Пуантилизм",
|
||||
"Artstyle Pop Art": "Стиль Поп Арт",
|
||||
"Artstyle Psychedelic": "Стиль Психоделик",
|
||||
"Artstyle Renaissance": "Стиль Ренессанс",
|
||||
"Artstyle Steampunk": "Стиль Стимпанк",
|
||||
"Artstyle Surrealist": "Стиль Сюрреализм",
|
||||
"Artstyle Typography": "Стиль Типография",
|
||||
"Artstyle Watercolor": "Стиль Акварель",
|
||||
"Futuristic Biomechanical": "Футуризм Биомеханика",
|
||||
"Futuristic Biomechanical Cyberpunk": "Футуризм Биомеханика Стимпагнк",
|
||||
"Futuristic Cybernetic": "Футуризм Кибернетик",
|
||||
"Futuristic Cybernetic Robot": "Футуризм Кибернетик Робот",
|
||||
"Futuristic Cyberpunk Cityscape": "Футуризм Киберпанк Город",
|
||||
"Futuristic Futuristic": "Футуризм стиль",
|
||||
"Futuristic Retro Cyberpunk": "Футуризм Ретро Киберпанк",
|
||||
"Futuristic Retro Futurism": "Футуризм Ретро Футуризм",
|
||||
"Futuristic Sci Fi": "Футуризм НЛО",
|
||||
"Futuristic Vaporwave": "Футуризм 80-е Vaporwave",
|
||||
"Game Bubble Bobble": "Игра Bubble Bobble",
|
||||
"Game Cyberpunk Game": "Игра Cyberpunk",
|
||||
"Game Fighting Game": "Игра Файтинг",
|
||||
"Game Gta": "Игра GTA",
|
||||
"Game Mario": "Игра Mario",
|
||||
"Game Minecraft": "Игра Minecraft",
|
||||
"Game Pokemon": "Игра Pokemon",
|
||||
"Game Retro Arcade": "Игра Ретро Аркада",
|
||||
"Game Retro Game": "Игра Ретро",
|
||||
"Game Rpg Fantasy Game": "Игра РПГ Фентези",
|
||||
"Game Strategy Game": "Игра Стратегия",
|
||||
"Game Streetfighter": "Игра Стритфайтер",
|
||||
"Game Zelda": "Игра Zelda",
|
||||
"Misc Architectural": "Тема Архитектура",
|
||||
"Misc Disco": "Тема Диско",
|
||||
"Misc Dreamscape": "Тема Dreamscape",
|
||||
"Misc Dystopian": "Тема Антиутопия",
|
||||
"Misc Fairy Tale": "Тема Сказка",
|
||||
"Misc Gothic": "Тема Готика",
|
||||
"Misc Grunge": "Тема Гранж Grunge",
|
||||
"Misc Horror": "Тема Ужасы Хорор",
|
||||
"Misc Kawaii": "Тема Kawaii",
|
||||
"Misc Lovecraftian": "Тема Лавкрафт",
|
||||
"Misc Macabre": "Тема Macabre",
|
||||
"Misc Manga": "Тема Манга Manga",
|
||||
"Misc Metropolis": "Тема Metropolis",
|
||||
"Misc Minimalist": "Тема Минимализм",
|
||||
"Misc Monochrome": "Тема Монохром",
|
||||
"Misc Nautical": "Тема Морская",
|
||||
"Misc Space": "Тема Космос",
|
||||
"Misc Stained Glass": "Теам Витраж",
|
||||
"Misc Techwear Fashion": "Тема Мода Техническая",
|
||||
"Misc Tribal": "Тема Племя Tribal",
|
||||
"Misc Zentangle": "Тема Зентангл Zentangle",
|
||||
"Papercraft Collage": "Бумага Коллаж",
|
||||
"Papercraft Flat Papercut": "Бумага Плоская вырезка",
|
||||
"Papercraft Kirigami": "Ьумага Киригами Kirigami",
|
||||
"Papercraft Paper Mache": "Бумага Папье-маше",
|
||||
"Papercraft Paper Quilling": "Бумага Квиллинг Quilling",
|
||||
"Papercraft Papercut Collage": "Бумага Вырезанный коллаж",
|
||||
"Papercraft Papercut Shadow Box": "Бумага Шкатулка для теней",
|
||||
"Papercraft Stacked Papercut": "Бумага Объемная сцена",
|
||||
"Papercraft Thick Layered Papercut": "Бумага Толстая вырезка",
|
||||
"Photo Alien": "Фото Пришелец",
|
||||
"Photo Film Noir": "Фото Фильм Нуар",
|
||||
"Photo Glamour": "Фото Гламур",
|
||||
"Photo Hdr": "Фото HDR",
|
||||
"Photo Iphone Photographic": "Фото Iphone",
|
||||
"Photo Long Exposure": "Фото Длинная Экспозиция",
|
||||
"Photo Neon Noir": "Фото Неон Нуар",
|
||||
"Photo Silhouette": "Фото Силуэт",
|
||||
"Photo Tilt Shift": "Фото Миниатюра Tilt Shift",
|
||||
"Cinematic Diva": "Фильм Дива",
|
||||
"Abstract Expressionism": "Стиль Абстрактный Экспрессионизм",
|
||||
"Academia": "Стиль Academia",
|
||||
"Action Figure": "Тема Миниатюра Статуэтка",
|
||||
"Adorable 3D Character": "Тема Очаровательный 3D-персонаж",
|
||||
"Adorable Kawaii": "Тема Очаровательный Kawaii",
|
||||
"Art Deco": "Стиль Арт Деко",
|
||||
"Art Nouveau": "Стидь Арт Нуво",
|
||||
"Astral Aura": "Тема Астральная аура",
|
||||
"Avant Garde": "Стиль Авангард",
|
||||
"Baroque": "Стиль Барокко",
|
||||
"Bauhaus Style Poster": "Тема Плакат Баухаус",
|
||||
"Blueprint Schematic Drawing": "Рисунок Схематический чертеж",
|
||||
"Caricature": "Рисунок Карикатура",
|
||||
"Cel Shaded Art": "Сел шейдинг Cel Shaded Арт",
|
||||
"Character Design Sheet": "Лист дизайна персонажа",
|
||||
"Classicism Art": "Классицизм Арт",
|
||||
"Color Field Painting": "Живопись цветового поля",
|
||||
"Colored Pencil Art": "Рисунок Цветными карандашами",
|
||||
"Conceptual Art": "Концептуальное искусство",
|
||||
"Constructivism": "Конструктивизм",
|
||||
"Cubism": "Кубизм",
|
||||
"Dadaism": "Дадаизм",
|
||||
"Dark Fantasy": "Темное Фентези",
|
||||
"Dark Moody Atmosphere": "Темная атмосфера",
|
||||
"Dmt Art Style": "Стиль Dmt",
|
||||
"Doodle Art": "Стиль Дудл Doodle",
|
||||
"Double Exposure": "Двойная экспозиция",
|
||||
"Dripping Paint Splatter Art": "Стиль разбрызгивания красок",
|
||||
"Expressionism": "Экспрессионизм",
|
||||
"Faded Polaroid Photo": "Фото Выцветший Палароид",
|
||||
"Fauvism": "Фовизм",
|
||||
"Flat 2d Art": "Стиль Плоский 2d Арт",
|
||||
"Fortnite Art Style": "Стиль Фортнайт Fortnite",
|
||||
"Futurism": "Футуризм 2",
|
||||
"Glitchcore": "Стиль Glitchcore",
|
||||
"Glo Fi": "Glo Fi",
|
||||
"Googie Art Style": "Стиль Googie",
|
||||
"Graffiti Art": "Стиль Граффити Graffiti",
|
||||
"Harlem Renaissance Art": "Стиль Возрождения Гарлема",
|
||||
"High Fashion": "Высокая мода",
|
||||
"Idyllic": "Стиль Идиллический",
|
||||
"Impressionism": "Стиль Импрессионизм",
|
||||
"Infographic Drawing": "Рисование инфографики",
|
||||
"Ink Dripping Drawing": "Рисунок тушью",
|
||||
"Japanese Ink Drawing": "Японский рисунок тушью",
|
||||
"Knolling Photography": "Фото Кноллинг Knolling",
|
||||
"Light Cheery Atmosphere": "Легкая Веселая Атмосфераe",
|
||||
"Logo Design": "Дизайн Лого",
|
||||
"Luxurious Elegance": "Люкс Роскошная Элегантность",
|
||||
"Macro Photography": "Фото Макро",
|
||||
"Mandola Art": "Тема Мандола Mandola",
|
||||
"Marker Drawing": "Рисование Маркерами",
|
||||
"Medievalism": "Средневековье",
|
||||
"Minimalism": "Минимализм",
|
||||
"Neo Baroque": "Neo Baroque",
|
||||
"Neo Byzantine": "Нео-Барокко",
|
||||
"Neo Futurism": "Неофутуризм",
|
||||
"Neo Impressionism": "Неоимпрессионизм",
|
||||
"Neo Rococo": "Нео-Рококо",
|
||||
"Neoclassicism": "Неоклассицизм",
|
||||
"Op Art": "Стиль Оптический Op Art",
|
||||
"Ornate And Intricate": "Витиеватые и замысловатые",
|
||||
"Pencil Sketch Drawing": "Рисование карандашом",
|
||||
"Pop Art 2": "Pop Art 2",
|
||||
"Rococo": "Rococo",
|
||||
"Silhouette Art": "Силуэт Арт",
|
||||
"Simple Vector Art": "Простой Векторный Арт",
|
||||
"Sketchup": "Скетч Чертеж Sketchup",
|
||||
"Steampunk 2": "Стимпанк 2",
|
||||
"Surrealism": "Сюрреализм",
|
||||
"Suprematism": "Супрематизм",
|
||||
"Terragen": "Ландшафт Terragen",
|
||||
"Tranquil Relaxing Atmosphere": "Спокойная Расслабляющая Атмосфера",
|
||||
"Sticker Designs": "Дизайн Стикеров",
|
||||
"Vibrant Rim Light": "Обрамляющий Свет",
|
||||
"Volumetric Lighting": "Объемный Свет Освещение",
|
||||
"Watercolor 2": "Акварель 2",
|
||||
"Whimsical And Playful": "Причудливый и Игривый",
|
||||
"Mk Van Gogh": "Mк Художник Ван Гог",
|
||||
"Futuristic Cybernetic Robot": "Mк Футуризм Кибернетический Робот",
|
||||
"Mk Vintage Travel Poster": "Mк Винтажный Туристический Плакат",
|
||||
"Mk Punk Collage": "Mк Панк Коллаж",
|
||||
"Mk Color Sketchnote": "Mк Цветной Эскиз",
|
||||
"Mk Pictorialism": "Mк Пикториализм",
|
||||
"Mk Chromolithography": "Mк Хромолитография",
|
||||
"Mk Cross Processing Print": "Mк Перекрестная обработка печати",
|
||||
"Mk Dufaycolor Photograph": "Mк Фото старая пленка Dufaycolor",
|
||||
"Mk Herbarium": "Mк Гербарий",
|
||||
"Mk Mosaic": "Mк Мозаика",
|
||||
"Mk Coloring Book": "Mк Книжка раскраска",
|
||||
"Mk Singer Sargent": "Mк Художник Singer Sargent",
|
||||
"Mk Pollock": "Mк Художник Pollock",
|
||||
"Mk Basquiat": "Mк Художник Basquiat",
|
||||
"Mk Andy Warhol": "Mк Художник Andy Warhol",
|
||||
"Mk Halftone Print": "Mк Полутоновый принт",
|
||||
"Mk Gond Painting": "Mк Гондская роспись",
|
||||
"Mk Albumen Print": "Mк Фотоальбом",
|
||||
"Mk Aquatint Print": "Mк Акватинтная печать",
|
||||
"Mk Anthotype Print": "Mк Антотипия печать",
|
||||
"Mk Inuit Carving": "Mк Резьба Инуитов",
|
||||
"Mk Bromoil Print": "Mк Бромойль печать",
|
||||
"Mk Calotype Print": "Mк Калотипия печать",
|
||||
"Mk Cibulak Porcelain": "Mк Цибулякский фарфор",
|
||||
"Mk Alcohol Ink Art": "Mк Спиртовые чернила",
|
||||
"Mk One Line Art": "Mк Искусство одной линии",
|
||||
"Mk Blacklight Paint": "Mк Светящаяся краска",
|
||||
"Mk Carnival Glass": "Mк Карнавальное стекло",
|
||||
"Mk Cyanotype Print": "Mк Цианотипия Печать",
|
||||
"Mk Cross Stitching": "Mк Вышивание крестом",
|
||||
"Mk Encaustic Paint": "Mк Энкаустическая краска",
|
||||
"Mk Embroidery": "Mк Вышивка",
|
||||
"Mk Gyotaku": "Mк Печать рыбы Gyotaku",
|
||||
"Mk Luminogram": "Mк Люминограмма",
|
||||
"Mk Lite Brite Art": "Mк Lite Brite Art",
|
||||
"Mk Mokume Gane": "Mк Мокумэ-ганэ Mokume Gane",
|
||||
"Pebble Art": "Mк Галечное искусство",
|
||||
"Mk Palekh": "Mк Палех Palekh",
|
||||
"Mk Suminagashi": "Mк Суминагаси Suminagashi",
|
||||
"Mk Scrimshaw": "Mк Скримшоу Scrimshaw",
|
||||
"Mk Shibori": "Mк Шибори Shibori",
|
||||
"Mk Vitreous Enamel": "Mк Стеклокерамика",
|
||||
"Mk Ukiyo E": "Mк Укиё-э Ukiyo E",
|
||||
"Mk Vintage Airline Poster": "Mк Винтажный плакат авиакомпании",
|
||||
"Mk Bauhaus Style": "Mк Баухаус Bauhaus",
|
||||
"Mk Afrofuturism": "Mк Афрофутуризм",
|
||||
"Mk Atompunk": "Mк Атомпанк",
|
||||
"Mk Constructivism": "Mк Конструктивизм",
|
||||
"Mk Chicano Art": "Mк Искусство Чикано",
|
||||
"Mk De Stijl": "Mк Де Стейл De Stijl",
|
||||
"Mk Dayak Art": "Mк Искусство Даяков",
|
||||
"Mk Fayum Portrait": "Mк Фаюмский портрет",
|
||||
"Mk Illuminated Manuscript": "Mк Иллюминированная рукопись",
|
||||
"Mk Kalighat Painting": "Mк Живопись Калигхат",
|
||||
"Mk Madhubani Painting": "Mк Живопись Мадхубани",
|
||||
"Mk Pichwai Painting": "Mк Пичвайская роспись",
|
||||
"Mk Patachitra Painting": "Mк Патачитра Живопись",
|
||||
"Mk Samoan Art Inspired": "Mк Samoan Art",
|
||||
"Mk Tlingit Art": "Mк Тлинкитское искусство",
|
||||
"Mk Adnate Style": "Mк Аднатский стиль",
|
||||
"Mk Ron English Style": "Mк Художник Ron English",
|
||||
"Mk Shepard Fairey Style": "Mк Художник Shepard Fairey",
|
||||
"Model": "Модель",
|
||||
"Base Model (SDXL only)": "Базовая модель (только для SDXL)",
|
||||
"sd_xl_base_1.0_0.9vae.safetensors": "sd_xl_base_1.0_0.9vae.safetensors",
|
||||
"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_refiner_1.0_0.9vae.safetensors": "sd_xl_refiner_1.0_0.9vae.safetensors",
|
||||
"Refiner (SDXL or SD 1.5)": "Постобработчик(SDXL или SD 1.5)",
|
||||
"None": "Нет",
|
||||
"LoRAs": "LoRAs",
|
||||
"SDXL LoRA 1": "SDXL LoRA 1",
|
||||
"sd_xl_offset_example-lora_1.0.safetensors": "sd_xl_offset_example-lora_1.0.safetensors",
|
||||
"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",
|
||||
"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": "Обновить",
|
||||
"\ud83d\udd04 Refresh All Files": "\ud83d\udd04 Обновить все файлы",
|
||||
"Image Sharpness": "Резкость изображения",
|
||||
"Higher value means image and texture are sharper.": "Более высокое значение означает, что изображение и текстура будут более детализированее м четкие.",
|
||||
"Guidance Scale": "Шкала рекомендаций",
|
||||
"Higher value means style is cleaner, vivider, and more artistic.": "Высокое значение означает, что стиль чище, ярче и художественнее, но контрастнее",
|
||||
"Developer Debug Mode": "Расширенные настройки",
|
||||
"Developer Debug Tools": "Средства отладки для разработчиков",
|
||||
"Debug Tools": "Инструменты",
|
||||
"Positive ADM Guidance Scaler": "Множитель положительной подсказки",
|
||||
"The scaler multiplied to positive ADM (use 1.0 to disable). ": "Множитель добавляющий вес положительной подсказке (1.0 для отключяения). ",
|
||||
"Negative ADM Guidance Scaler": "Множитель негативной подсказки",
|
||||
"The scaler multiplied to negative ADM (use 1.0 to disable). ": "Множитель добавляющий вес негативной подсказке (1.0 для отключяения). ",
|
||||
"ADM Guidance End At Step": "Прекратить обработку множителя на шаге",
|
||||
"When to end the guidance from positive/negative ADM. ": "Указывает когда прекратить обработку множителя позитивной/негативной подсказки ADM. (1.0 = 100%)",
|
||||
"Refiner swap method": "Метод работы постобработчика",
|
||||
"joint": "смешанный",
|
||||
"separate": "отдельно",
|
||||
"vae": "vae",
|
||||
"CFG Mimicking from TSNR": "CFG Mimicking from TSNR",
|
||||
"Sampler": "Сэмплер",
|
||||
"dpmpp_2m_sde_gpu": "dpmpp_2m_sde_gpu",
|
||||
"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_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",
|
||||
"karras": "karras",
|
||||
"Scheduler of Sampler.": "Scheduler of Sampler.",
|
||||
"normal": "normal",
|
||||
"exponential": "exponential",
|
||||
"sgm_uniform": "sgm_uniform",
|
||||
"simple": "simple",
|
||||
"ddim_uniform": "ddim_uniform",
|
||||
"Generate Image Grid for Each Batch": "Создайть сетку изображений для каждой партии",
|
||||
"(Experimental) This may cause performance problems on some computers and certain internet conditions.": "Это может вызвать проблемы с производительностью на некоторых компьютерах и при определенных условиях работы в Интернете.",
|
||||
"Forced Overwrite of Sampling Step": "Принудительная перезапись шага выборки",
|
||||
"Set as -1 to disable. For developer debugging.": "Установите значение -1, чтобы отключить. Для опытных пользователей.",
|
||||
"Forced Overwrite of Refiner Switch Step": "Принудительная перезапись шага переключения постобработчика",
|
||||
"Forced Overwrite of Generating Width": "Принудительная установка Ширины генерируемого изображения",
|
||||
"Forced Overwrite of Generating Height": "Принудительная установка Высоты генерируемого изображения",
|
||||
"Set as -1 to disable. For developer debugging. Results will be worse for non-standard numbers that SDXL is not trained on.": "Установите значение -1, чтобы отключить. Для опытных пользователей. Результаты будут хуже для нестандартных чисел, на которых SDXL не обучался",
|
||||
"Forced Overwrite of Denoising Strength of \"Vary\"": "Сила шумоподавления в режиме \"Изменить\"",
|
||||
"Set as negative number to disable. For developer debugging.": "Установите значение -1, чтобы отключить. Для опытных пользователей.",
|
||||
"Forced Overwrite of Denoising Strength of \"Upscale\"": "Сила шумоподавления в режиме \"Увеличить\"",
|
||||
"Disable Preview": "Отключить просмотр",
|
||||
"Disable preview during generation.": "Отключает предварительный просмотр во время генерации.",
|
||||
"Inpaint Engine": "Механизм Inpaint",
|
||||
"v1": "v1",
|
||||
"Version of Fooocus inpaint model": "Версия модели Fooocus для Inpaint",
|
||||
"v2.5": "v2.5",
|
||||
"Control Debug": "Отладка управления",
|
||||
"Debug Preprocessors": "Предпроцессор отладки",
|
||||
"See the results from preprocessors.": "Показывать предварительную обработку.",
|
||||
"Skip Preprocessors": "Пропустить предварительную обработку",
|
||||
"Do not preprocess images. (Inputs are already canny/depth/cropped-face/etc.)": "Отключить предварительную обработку изображений (Рекомендуется, если входные изображения искажены)",
|
||||
"Mixing Image Prompt and Vary/Upscale": "Смешивать подсказки изображения в режиме Изменить/Увеличить",
|
||||
"Mixing Image Prompt and Inpaint": "Смешивать подсказки изображения в режиме Inpaint",
|
||||
"Softness of ControlNet": "Мягкость воздействия ControlNet",
|
||||
"Similar to the Control Mode in A1111 (use 0.0 to disable). ": "Тоже что и Control Mode в A1111 (0.0 для отключения). ",
|
||||
"Canny": "Контуры (Canny)",
|
||||
"Canny Low Threshold": "MIN порог для Контуров",
|
||||
"Canny High Threshold": "MAX порог для Контуров",
|
||||
"Inpaint": "Inpaint",
|
||||
"Debug Inpaint Preprocessing": "Отладка предварительной обработки рисунка",
|
||||
"Disable initial latent in inpaint": "Отключение начальной латентности в Inpaint",
|
||||
"Inpaint Denoising Strength": "Уровень шумоподавления в Inpaint",
|
||||
"Same as the denoising strength in A1111 inpaint. Only used in inpaint, not used in outpaint. (Outpaint always use 1.0)": "То же, что и denoising strength в A1111 inpaint. Используется только в режиме Inpaint, в режиме Outpaint не используется.",
|
||||
"Inpaint Respective Field": "Область анализа Inpaint. 0 - Только Маска. 1 - Все изображение. ",
|
||||
"Mask Erode or Dilate": "Коррекция размера контуров маски",
|
||||
"Positive value will make white area in the mask larger negative value will make white area smaller.(default is 0, always process before any mask invert)": "При положительном значении белая область в маске увеличивается при отрицательном - уменьшается. (По умолчанию 0 - всегда обрабатывается перед инвертированием маски)",
|
||||
"Enable Mask Upload": "Включить загрузку маски",
|
||||
"Invert Mask": "Инвертирующая маска",
|
||||
"FreeU": "FreeU",
|
||||
"Enabled": "Включено",
|
||||
"B1": "B1",
|
||||
"B2": "B2",
|
||||
"S1": "S1",
|
||||
"S2": "S2",
|
||||
"Extreme Speed": "Супер скорость",
|
||||
"\uD83D\uDD0E Type here to search styles ...": "\uD83D\uDD0E Поиск стилей.",
|
||||
"Type prompt here.": "Введите запрос здесь.",
|
||||
"Outpaint Expansion Direction:": "Направление расширения Дорисовки:",
|
||||
"* Powered by Fooocus Inpaint Engine (beta)": "* Работает на движке Fooocus Inpaint Engine (beta)",
|
||||
"Fooocus Enhance": "Fooocus Улучшение",
|
||||
"Fooocus Cinematic": "Fooocus Кинематографичность",
|
||||
"Fooocus Sharp": "Fooocus Резкость"
|
||||
|
||||
}
|
||||
|
|
@ -8,7 +8,7 @@ class CLIPEmbeddingNoiseAugmentation(ImageConcatWithNoiseAugmentation):
|
|||
if clip_stats_path is None:
|
||||
clip_mean, clip_std = torch.zeros(timestep_dim), torch.ones(timestep_dim)
|
||||
else:
|
||||
clip_mean, clip_std = torch.load(clip_stats_path, map_location="cpu")
|
||||
clip_mean, clip_std = torch.load(clip_stats_path, map_location="cpu", weights_only=True)
|
||||
self.register_buffer("data_mean", clip_mean[None, :], persistent=False)
|
||||
self.register_buffer("data_std", clip_std[None, :], persistent=False)
|
||||
self.time_embed = Timestep(timestep_dim)
|
||||
|
|
|
|||
|
|
@ -326,7 +326,7 @@ def load_embed(embedding_name, embedding_directory, embedding_size, embed_key=No
|
|||
except:
|
||||
embed_out = safe_load_embed_zip(embed_path)
|
||||
else:
|
||||
embed = torch.load(embed_path, map_location="cpu")
|
||||
embed = torch.load(embed_path, map_location="cpu", weights_only=True)
|
||||
except Exception as e:
|
||||
print(traceback.format_exc())
|
||||
print()
|
||||
|
|
|
|||
|
|
@ -377,15 +377,15 @@ class VQAutoEncoder(nn.Module):
|
|||
)
|
||||
|
||||
if model_path is not None:
|
||||
chkpt = torch.load(model_path, map_location="cpu")
|
||||
chkpt = torch.load(model_path, map_location="cpu", weights_only=True)
|
||||
if "params_ema" in chkpt:
|
||||
self.load_state_dict(
|
||||
torch.load(model_path, map_location="cpu")["params_ema"]
|
||||
torch.load(model_path, map_location="cpu", weights_only=True)["params_ema"]
|
||||
)
|
||||
logger.info(f"vqgan is loaded from: {model_path} [params_ema]")
|
||||
elif "params" in chkpt:
|
||||
self.load_state_dict(
|
||||
torch.load(model_path, map_location="cpu")["params"]
|
||||
torch.load(model_path, map_location="cpu", weights_only=True)["params"]
|
||||
)
|
||||
logger.info(f"vqgan is loaded from: {model_path} [params]")
|
||||
else:
|
||||
|
|
|
|||
|
|
@ -273,8 +273,8 @@ class GFPGANBilinear(nn.Module):
|
|||
if decoder_load_path:
|
||||
self.stylegan_decoder.load_state_dict(
|
||||
torch.load(
|
||||
decoder_load_path, map_location=lambda storage, loc: storage
|
||||
)["params_ema"]
|
||||
decoder_load_path, map_location=lambda storage, loc: storage,
|
||||
weights_only=True)["params_ema"]
|
||||
)
|
||||
# fix decoder without updating params
|
||||
if fix_decoder:
|
||||
|
|
|
|||
|
|
@ -373,8 +373,8 @@ class GFPGANv1(nn.Module):
|
|||
if decoder_load_path:
|
||||
self.stylegan_decoder.load_state_dict(
|
||||
torch.load(
|
||||
decoder_load_path, map_location=lambda storage, loc: storage
|
||||
)["params_ema"]
|
||||
decoder_load_path, map_location=lambda storage, loc: storage,
|
||||
weights_only=True)["params_ema"]
|
||||
)
|
||||
# fix decoder without updating params
|
||||
if fix_decoder:
|
||||
|
|
|
|||
|
|
@ -284,8 +284,8 @@ class GFPGANv1Clean(nn.Module):
|
|||
if decoder_load_path:
|
||||
self.stylegan_decoder.load_state_dict(
|
||||
torch.load(
|
||||
decoder_load_path, map_location=lambda storage, loc: storage
|
||||
)["params_ema"]
|
||||
decoder_load_path, map_location=lambda storage, loc: storage,
|
||||
weights_only=True)["params_ema"]
|
||||
)
|
||||
# fix decoder without updating params
|
||||
if fix_decoder:
|
||||
|
|
|
|||
|
|
@ -702,6 +702,19 @@ default_inpaint_mask_sam_model = get_config_item_or_set_default(
|
|||
expected_type=str
|
||||
)
|
||||
|
||||
default_describe_apply_prompts_checkbox = get_config_item_or_set_default(
|
||||
key='default_describe_apply_prompts_checkbox',
|
||||
default_value=True,
|
||||
validator=lambda x: isinstance(x, bool),
|
||||
expected_type=bool
|
||||
)
|
||||
default_describe_content_type = get_config_item_or_set_default(
|
||||
key='default_describe_content_type',
|
||||
default_value=[modules.flags.describe_type_photo],
|
||||
validator=lambda x: all(k in modules.flags.describe_types for k in x),
|
||||
expected_type=list
|
||||
)
|
||||
|
||||
config_dict["default_loras"] = default_loras = default_loras[:default_max_lora_number] + [[True, 'None', 1.0] for _ in range(default_max_lora_number - len(default_loras))]
|
||||
|
||||
# mapping config to meta parameter
|
||||
|
|
|
|||
|
|
@ -231,7 +231,7 @@ def get_previewer(model):
|
|||
if vae_approx_filename in VAE_approx_models:
|
||||
VAE_approx_model = VAE_approx_models[vae_approx_filename]
|
||||
else:
|
||||
sd = torch.load(vae_approx_filename, map_location='cpu')
|
||||
sd = torch.load(vae_approx_filename, map_location='cpu', weights_only=True)
|
||||
VAE_approx_model = VAEApprox()
|
||||
VAE_approx_model.load_state_dict(sd)
|
||||
del sd
|
||||
|
|
|
|||
|
|
@ -96,6 +96,7 @@ inpaint_options = [inpaint_option_default, inpaint_option_detail, inpaint_option
|
|||
|
||||
describe_type_photo = 'Photograph'
|
||||
describe_type_anime = 'Art/Anime'
|
||||
describe_types = [describe_type_photo, describe_type_anime]
|
||||
|
||||
sdxl_aspect_ratios = [
|
||||
'704*1408', '704*1344', '768*1344', '768*1280', '832*1216', '832*1152',
|
||||
|
|
|
|||
|
|
@ -196,7 +196,7 @@ class InpaintWorker:
|
|||
|
||||
if inpaint_head_model is None:
|
||||
inpaint_head_model = InpaintHead()
|
||||
sd = torch.load(inpaint_head_model_path, map_location='cpu')
|
||||
sd = torch.load(inpaint_head_model_path, map_location='cpu', weights_only=True)
|
||||
inpaint_head_model.load_state_dict(sd)
|
||||
|
||||
feed = torch.cat([
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ def perform_upscale(img):
|
|||
|
||||
if model is None:
|
||||
model_filename = downloading_upscale_model()
|
||||
sd = torch.load(model_filename)
|
||||
sd = torch.load(model_filename, weights_only=True)
|
||||
sdo = OrderedDict()
|
||||
for k, v in sd.items():
|
||||
sdo[k.replace('residual_block_', 'RDB')] = v
|
||||
|
|
|
|||
|
|
@ -1,3 +1,8 @@
|
|||
# [2.5.3](https://github.com/lllyasviel/Fooocus/releases/tag/v2.5.3)
|
||||
|
||||
* Only load weights from non-safetensors files, preventing harmful code injection
|
||||
* Add checkbox for applying/resetting styles when describing images, also allowing multiple describe content types
|
||||
|
||||
# [2.5.2](https://github.com/lllyasviel/Fooocus/releases/tag/v2.5.2)
|
||||
|
||||
* Fix not adding positive prompt when styles didn't have a {prompt} placeholder in the positive prompt
|
||||
|
|
|
|||
61
webui.py
61
webui.py
|
|
@ -337,10 +337,11 @@ with shared.gradio_root:
|
|||
with gr.Column():
|
||||
describe_input_image = grh.Image(label='Image', source='upload', type='numpy', show_label=False)
|
||||
with gr.Column():
|
||||
describe_method = gr.Radio(
|
||||
describe_methods = gr.CheckboxGroup(
|
||||
label='Content Type',
|
||||
choices=[flags.describe_type_photo, flags.describe_type_anime],
|
||||
value=flags.describe_type_photo)
|
||||
choices=flags.describe_types,
|
||||
value=modules.config.default_describe_content_type)
|
||||
describe_apply_styles = gr.Checkbox(label='Apply Styles', value=modules.config.default_describe_apply_prompts_checkbox)
|
||||
describe_btn = gr.Button(value='Describe this Image into Prompt')
|
||||
describe_image_size = gr.Textbox(label='Image Size and Recommended Size', elem_id='describe_image_size', visible=False)
|
||||
gr.HTML('<a href="https://github.com/lllyasviel/Fooocus/discussions/1363" target="_blank">\U0001F4D4 Documentation</a>')
|
||||
|
|
@ -1060,30 +1061,54 @@ with shared.gradio_root:
|
|||
gr.Audio(interactive=False, value=notification_file, elem_id='audio_notification', visible=False)
|
||||
break
|
||||
|
||||
def trigger_describe(mode, img):
|
||||
if mode == flags.describe_type_photo:
|
||||
from extras.interrogate import default_interrogator as default_interrogator_photo
|
||||
return default_interrogator_photo(img), ["Fooocus V2", "Fooocus Enhance", "Fooocus Sharp"]
|
||||
if mode == flags.describe_type_anime:
|
||||
from extras.wd14tagger import default_interrogator as default_interrogator_anime
|
||||
return default_interrogator_anime(img), ["Fooocus V2", "Fooocus Masterpiece"]
|
||||
return mode, ["Fooocus V2"]
|
||||
def trigger_describe(modes, img, apply_styles):
|
||||
describe_prompts = []
|
||||
styles = set()
|
||||
|
||||
describe_btn.click(trigger_describe, inputs=[describe_method, describe_input_image],
|
||||
outputs=[prompt, style_selections], show_progress=True, queue=True)
|
||||
if flags.describe_type_photo in modes:
|
||||
from extras.interrogate import default_interrogator as default_interrogator_photo
|
||||
describe_prompts.append(default_interrogator_photo(img))
|
||||
styles.update(["Fooocus V2", "Fooocus Enhance", "Fooocus Sharp"])
|
||||
|
||||
if flags.describe_type_anime in modes:
|
||||
from extras.wd14tagger import default_interrogator as default_interrogator_anime
|
||||
describe_prompts.append(default_interrogator_anime(img))
|
||||
styles.update(["Fooocus V2", "Fooocus Masterpiece"])
|
||||
|
||||
if len(styles) == 0 or not apply_styles:
|
||||
styles = gr.update()
|
||||
else:
|
||||
styles = list(styles)
|
||||
|
||||
if len(describe_prompts) == 0:
|
||||
describe_prompt = gr.update()
|
||||
else:
|
||||
describe_prompt = ', '.join(describe_prompts)
|
||||
|
||||
return describe_prompt, styles
|
||||
|
||||
describe_btn.click(trigger_describe, inputs=[describe_methods, describe_input_image, describe_apply_styles],
|
||||
outputs=[prompt, style_selections], show_progress=True, queue=True) \
|
||||
.then(fn=style_sorter.sort_styles, inputs=style_selections, outputs=style_selections, queue=False, show_progress=False) \
|
||||
.then(lambda: None, _js='()=>{refresh_style_localization();}')
|
||||
|
||||
if args_manager.args.enable_auto_describe_image:
|
||||
def trigger_auto_describe(mode, img, prompt):
|
||||
def trigger_auto_describe(mode, img, prompt, apply_styles):
|
||||
# keep prompt if not empty
|
||||
if prompt == '':
|
||||
return trigger_describe(mode, img)
|
||||
return trigger_describe(mode, img, apply_styles)
|
||||
return gr.update(), gr.update()
|
||||
|
||||
uov_input_image.upload(trigger_auto_describe, inputs=[describe_method, uov_input_image, prompt],
|
||||
outputs=[prompt, style_selections], show_progress=True, queue=True)
|
||||
uov_input_image.upload(trigger_auto_describe, inputs=[describe_methods, uov_input_image, prompt, describe_apply_styles],
|
||||
outputs=[prompt, style_selections], show_progress=True, queue=True) \
|
||||
.then(fn=style_sorter.sort_styles, inputs=style_selections, outputs=style_selections, queue=False, show_progress=False) \
|
||||
.then(lambda: None, _js='()=>{refresh_style_localization();}')
|
||||
|
||||
enhance_input_image.upload(lambda: gr.update(value=True), outputs=enhance_checkbox, queue=False, show_progress=False) \
|
||||
.then(trigger_auto_describe, inputs=[describe_method, enhance_input_image, prompt], outputs=[prompt, style_selections], show_progress=True, queue=True)
|
||||
.then(trigger_auto_describe, inputs=[describe_methods, enhance_input_image, prompt, describe_apply_styles],
|
||||
outputs=[prompt, style_selections], show_progress=True, queue=True) \
|
||||
.then(fn=style_sorter.sort_styles, inputs=style_selections, outputs=style_selections, queue=False, show_progress=False) \
|
||||
.then(lambda: None, _js='()=>{refresh_style_localization();}')
|
||||
|
||||
def dump_default_english_config():
|
||||
from modules.localization import dump_english_config
|
||||
|
|
|
|||
Loading…
Reference in New Issue