mirror of
https://github.com/vladmandic/automatic
synced 2026-09-19 01:04:32 +02:00
update lightning and unipc
This commit is contained in:
@@ -114,6 +114,7 @@ Fork does differ in few things:
|
||||
- Drops compatibility with `python` **3.7** and requires **3.9**
|
||||
Recommended is **Python 3.10**
|
||||
Note that **Python 3.11** or **3.12** are NOT supported
|
||||
- Drops localizations
|
||||
- Updated **Python** libraries to latest known compatible versions
|
||||
e.g. `accelerate`, `transformers`, `numpy`, etc.
|
||||
- Includes opinionated **System** and **Options** configuration
|
||||
|
||||
+11
-5
@@ -25,9 +25,9 @@
|
||||
"control_net_only_midctrl_hires": true,
|
||||
"control_net_allow_script_control": false,
|
||||
"control_net_skip_img2img_processing": false,
|
||||
"control_net_monocular_depth_optim": false,
|
||||
"control_net_monocular_depth_optim": true,
|
||||
"control_net_only_mid_control": false,
|
||||
"control_net_cfg_based_guidance": false,
|
||||
"control_net_cfg_based_guidance": true,
|
||||
"dataset_filename_join_string": " ",
|
||||
"dataset_filename_word_regex": "",
|
||||
"ddim_discretize": "uniform",
|
||||
@@ -132,7 +132,7 @@
|
||||
"localization": "None",
|
||||
"lora_apply_to_outputs": false,
|
||||
"memmon_poll_rate": 1,
|
||||
"multiple_tqdm": false,
|
||||
"multiple_tqdm": true,
|
||||
"n_rows": -1,
|
||||
"no_dpmpp_sde_batch_determinism": false,
|
||||
"outdir_extras_samples": "outputs/extras",
|
||||
@@ -213,7 +213,13 @@
|
||||
"use_upscaler_name_as_suffix": true,
|
||||
"img_max_size_mp": 200.0,
|
||||
"image_browser_active_tabs": "txt2img, img2img, txt2img-grids, img2img-grids, Extras, Favorites, Others, Maintenance",
|
||||
"image_browser_enable_maint": true,
|
||||
"image_browser_enable_maint": false,
|
||||
"image_browser_ranking_pnginfo": false,
|
||||
"uni_pc_order": 3
|
||||
"uni_pc_order": 3,
|
||||
"webp_lossless": false,
|
||||
"extra_networks_add_text_separator": " ",
|
||||
"uni_pc_variant": "bh1",
|
||||
"uni_pc_skip_type": "time_uniform",
|
||||
"uni_pc_lower_order_final": true,
|
||||
"image_browser_hidden_components": []
|
||||
}
|
||||
@@ -17,7 +17,8 @@ index_url = os.environ.get('INDEX_URL', "")
|
||||
stored_commit_hash = None
|
||||
skip_install = False
|
||||
|
||||
warnings.filterwarnings("ignore", category=UserWarning)
|
||||
warnings.filterwarnings(action="ignore", category=UserWarning)
|
||||
warnings.filterwarnings(action="ignore", category=DeprecationWarning)
|
||||
|
||||
def check_python_version():
|
||||
is_windows = platform.system() == "Windows"
|
||||
@@ -28,7 +29,7 @@ def check_python_version():
|
||||
if is_windows:
|
||||
supported_minors = [10]
|
||||
else:
|
||||
supported_minors = [7, 8, 9, 10, 11]
|
||||
supported_minors = [9, 10, 11]
|
||||
|
||||
if not (major == 3 and minor in supported_minors):
|
||||
import modules.errors
|
||||
|
||||
@@ -71,7 +71,7 @@ class UniPCSampler(object):
|
||||
# sampling
|
||||
C, H, W = shape
|
||||
size = (batch_size, C, H, W)
|
||||
print(f'Data shape for UniPC sampling is {size}')
|
||||
# print(f'Data shape for UniPC sampling is {size}')
|
||||
|
||||
device = self.model.betas.device
|
||||
if x_T is None:
|
||||
|
||||
@@ -750,7 +750,7 @@ class UniPC:
|
||||
if method == 'multistep':
|
||||
assert steps >= order, "UniPC order must be < sampling steps"
|
||||
timesteps = self.get_time_steps(skip_type=skip_type, t_T=t_T, t_0=t_0, N=steps, device=device)
|
||||
print(f"Running UniPC Sampling with {timesteps.shape[0]} timesteps, order {order}")
|
||||
# print(f"Running UniPC Sampling with {timesteps.shape[0]} timesteps, order {order}")
|
||||
assert timesteps.shape[0] - 1 == steps
|
||||
with torch.no_grad():
|
||||
vec_t = timesteps[0].expand((x.shape[0]))
|
||||
|
||||
+3
-2
@@ -5,7 +5,6 @@ import os
|
||||
import sys
|
||||
import time
|
||||
|
||||
from PIL import Image
|
||||
import gradio as gr
|
||||
import tqdm
|
||||
|
||||
@@ -48,6 +47,7 @@ parser.add_argument("--always-batch-cond-uncond", action='store_true', help="dis
|
||||
parser.add_argument("--unload-gfpgan", action='store_true', help="does not do anything.")
|
||||
parser.add_argument("--precision", type=str, help="evaluate at this precision", choices=["full", "autocast"], default="autocast")
|
||||
parser.add_argument("--upcast-sampling", action='store_true', help="upcast sampling. No effect with --no-half. Usually produces similar results to --no-half with better performance while using less memory.")
|
||||
parser.add_argument("--profile", action='store_true', help="run profiler")
|
||||
parser.add_argument("--share", action='store_true', help="use share=True for gradio and make the UI accessible through their site")
|
||||
parser.add_argument("--ngrok", type=str, help="ngrok authtoken, alternative to gradio --share", default=None)
|
||||
parser.add_argument("--ngrok-region", type=str, help="The region in which ngrok should start.", default="us")
|
||||
@@ -688,7 +688,7 @@ class TotalTQDM:
|
||||
|
||||
def reset(self):
|
||||
self._tqdm = tqdm.tqdm(
|
||||
desc="Total progress",
|
||||
desc="Total",
|
||||
total=state.job_count * state.sampling_steps,
|
||||
position=1,
|
||||
file=progress_print_out
|
||||
@@ -710,6 +710,7 @@ class TotalTQDM:
|
||||
|
||||
def clear(self):
|
||||
if self._tqdm is not None:
|
||||
self._tqdm.refresh()
|
||||
self._tqdm.close()
|
||||
self._tqdm = None
|
||||
|
||||
|
||||
+2
-6
@@ -42,8 +42,6 @@ import modules.hypernetworks.ui
|
||||
from modules.generation_parameters_copypaste import image_from_url_text
|
||||
import modules.extras
|
||||
|
||||
warnings.filterwarnings("default" if opts.show_warnings else "ignore", category=UserWarning)
|
||||
|
||||
# this is a fix for Windows users. Without it, javascript files will be served with text/html content-type and the browser will not show any UI
|
||||
mimetypes.init()
|
||||
mimetypes.add_type('application/javascript', '.js')
|
||||
@@ -1784,11 +1782,9 @@ if not hasattr(shared, 'GradioTemplateResponseOriginal'):
|
||||
|
||||
def versions_html():
|
||||
import torch
|
||||
import launch
|
||||
from launch import commit_hash
|
||||
|
||||
python_version = ".".join([str(x) for x in sys.version_info[0:3]])
|
||||
commit = launch.commit_hash()
|
||||
short_commit = commit[0:8]
|
||||
|
||||
if shared.xformers_available:
|
||||
import xformers
|
||||
@@ -1810,7 +1806,7 @@ xformers: {xformers_version}
|
||||
•
|
||||
gradio: {gr.__version__}
|
||||
•
|
||||
commit: <a href="https://github.com/AUTOMATIC1111/stable-diffusion-webui/commit/{commit}">{short_commit}</a>
|
||||
commit: <a href="https://github.com/AUTOMATIC1111/stable-diffusion-webui/commit/{commit_hash()}">{commit_hash()[0:8]}</a>
|
||||
•
|
||||
checkpoint: <a id="sd_checkpoint_hash">N/A</a>
|
||||
"""
|
||||
|
||||
@@ -158,8 +158,8 @@ def install_extension_from_url(dirname, url):
|
||||
# Something else, not enough free space, permissions, etc. rethrow it so that it gets handled.
|
||||
raise(err)
|
||||
|
||||
import launch
|
||||
launch.run_extension_installer(target_dir)
|
||||
from launch import run_extension_installer
|
||||
run_extension_installer(target_dir)
|
||||
|
||||
extensions.list_extensions()
|
||||
return [extension_table(), html.escape(f"Installed into {target_dir}. Use Installed tab to restart.")]
|
||||
|
||||
@@ -1,28 +1,16 @@
|
||||
accelerate==0.16.0
|
||||
basicsr==1.4.2
|
||||
blendmodes==2022
|
||||
clean-fid==0.1.35
|
||||
diffusers==0.12.1
|
||||
einops==0.4.1
|
||||
fastapi==0.90.1
|
||||
gfpgan==1.3.8
|
||||
GitPython==3.1.31
|
||||
gradio==3.16.2
|
||||
inflection==0.5.1
|
||||
jsonmerge==1.9.0
|
||||
kornia==0.6.9
|
||||
lark==1.1.5
|
||||
numexpr==2.8.4
|
||||
omegaconf==2.3.0
|
||||
pandas==1.5.3
|
||||
Pillow==9.4.0
|
||||
protobuf==3.20.3
|
||||
pytorch_lightning==1.7.7
|
||||
pytorch_lightning==1.9.4
|
||||
realesrgan==0.3.0
|
||||
resize-right==0.0.2
|
||||
safetensors==0.3.0
|
||||
scikit-image==0.19.3
|
||||
timm==0.6.12
|
||||
torchdiffeq==0.2.3
|
||||
torchsde==0.2.5
|
||||
transformers==4.26.1
|
||||
|
||||
+4
-4
@@ -130,7 +130,7 @@
|
||||
"img2img/Resize seed from width/visible": true,
|
||||
"img2img/Restore faces/value": false,
|
||||
"img2img/Restore faces/visible": true,
|
||||
"img2img/Sampling method/value": "DPM2 Karras",
|
||||
"img2img/Sampling method/value": "Euler a",
|
||||
"img2img/Sampling method/visible": true,
|
||||
"img2img/Sampling steps/maximum": 150,
|
||||
"img2img/Sampling Steps/maximum": 200,
|
||||
@@ -465,7 +465,7 @@
|
||||
"txt2img/Resize width to/visible": true,
|
||||
"txt2img/Restore faces/value": false,
|
||||
"txt2img/Restore faces/visible": true,
|
||||
"txt2img/Sampling method/value": "DPM2 Karras",
|
||||
"txt2img/Sampling method/value": "UniPC",
|
||||
"txt2img/Sampling method/visible": true,
|
||||
"txt2img/Sampling steps/maximum": 150,
|
||||
"txt2img/Sampling Steps/maximum": 200,
|
||||
@@ -473,8 +473,8 @@
|
||||
"txt2img/Sampling Steps/minimum": 1,
|
||||
"txt2img/Sampling steps/step": 1,
|
||||
"txt2img/Sampling Steps/step": 1,
|
||||
"txt2img/Sampling steps/value": 20,
|
||||
"txt2img/Sampling Steps/value": 20,
|
||||
"txt2img/Sampling steps/value": 10,
|
||||
"txt2img/Sampling Steps/value": 10,
|
||||
"txt2img/Sampling steps/visible": true,
|
||||
"txt2img/Sampling Steps/visible": true,
|
||||
"txt2img/Script/value": "None",
|
||||
|
||||
@@ -3,6 +3,7 @@ import sys
|
||||
import time
|
||||
import importlib
|
||||
import signal
|
||||
import warnings
|
||||
import re
|
||||
from fastapi import FastAPI
|
||||
from fastapi.middleware.cors import CORSMiddleware
|
||||
@@ -17,6 +18,9 @@ from modules import paths, timer, import_hook, errors
|
||||
startup_timer = timer.Timer()
|
||||
|
||||
import torch
|
||||
import pytorch_lightning # pytorch_lightning re-enables warnings on import so import once to disable them
|
||||
warnings.filterwarnings(action="ignore", category=DeprecationWarning)
|
||||
|
||||
startup_timer.record("import torch")
|
||||
|
||||
import gradio
|
||||
|
||||
Reference in New Issue
Block a user