mirror of
https://github.com/vladmandic/automatic
synced 2026-09-06 13:00:44 +02:00
Merge remote-tracking branch 'upstream/dev' into Extended-Merging
This commit is contained in:
+2
-1
@@ -43,13 +43,14 @@
|
||||
- Support `--ckpt none` to skip loading a model
|
||||
- **XYZ grid**
|
||||
- Add refiner options to XYZ Grid
|
||||
- Add option to create only subimages in XYZ grid, thanks @midcoastal
|
||||
- Add option to create only subgrids in XYZ grid, thanks @midcoastal
|
||||
- Allow custom font, background and text color in settings
|
||||
- **Fixes**
|
||||
- Fix `params.txt` saved before actual image
|
||||
- Fix inpaint
|
||||
- Fix manual grid image save
|
||||
- Fix img2img init image save
|
||||
- Fix upscale in txt2img for batch counts when no hires is used
|
||||
- More uniform models paths
|
||||
- Safe scripts callback execution
|
||||
- Improved extension compatibility
|
||||
|
||||
+14
-15
@@ -442,7 +442,6 @@ def check_torch():
|
||||
torchvision_pip = 'https://github.com/Nuullll/intel-extension-for-pytorch/releases/download/v2.0.110%2Bxpu-master%2Bdll-bundle/torchvision-0.15.2a0+fa99a53-cp310-cp310-win_amd64.whl'
|
||||
ipex_pip = 'https://github.com/Nuullll/intel-extension-for-pytorch/releases/download/v2.0.110%2Bxpu-master%2Bdll-bundle/intel_extension_for_pytorch-2.0.110+gitc6ea20b-cp310-cp310-win_amd64.whl'
|
||||
torch_command = os.environ.get('TORCH_COMMAND', f'{pytorch_pip} {torchvision_pip} {ipex_pip}')
|
||||
uninstall('openvino-nightly')
|
||||
install('openvino', 'openvino', ignore=True)
|
||||
install('onnxruntime-openvino', 'onnxruntime-openvino', ignore=True) # TODO numpy version conflicts with tensorflow and doesn't support Python 3.11
|
||||
elif allow_openvino and args.use_openvino:
|
||||
@@ -544,8 +543,8 @@ def check_torch():
|
||||
if opts.get('cuda_compile_backend', '') == 'hidet':
|
||||
install('hidet', 'hidet')
|
||||
if args.use_openvino or opts.get('cuda_compile_backend', '') == 'openvino_fx':
|
||||
uninstall('openvino')
|
||||
install('openvino-nightly==2023.3.0.dev20231114', 'openvino-nightly')
|
||||
uninstall('openvino-nightly') # TODO remove after people had enough time upgrading
|
||||
install('openvino==2023.2.0', 'openvino')
|
||||
install('onnxruntime-openvino', 'onnxruntime-openvino', ignore=True) # TODO numpy version conflicts with tensorflow and doesn't support Python 3.11
|
||||
os.environ.setdefault('PYTORCH_TRACING_MODE', 'TORCHFX')
|
||||
os.environ.setdefault('NEOReadDebugKeys', '1')
|
||||
@@ -776,26 +775,26 @@ def install_requirements():
|
||||
# set environment variables controling the behavior of various libraries
|
||||
def set_environment():
|
||||
log.debug('Setting environment tuning')
|
||||
os.environ.setdefault('USE_TORCH', '1')
|
||||
os.environ.setdefault('TF_CPP_MIN_LOG_LEVEL', '2')
|
||||
os.environ.setdefault('ACCELERATE', 'True')
|
||||
os.environ.setdefault('FORCE_CUDA', '1')
|
||||
os.environ.setdefault('ATTN_PRECISION', 'fp16')
|
||||
os.environ.setdefault('PYTORCH_CUDA_ALLOC_CONF', 'garbage_collection_threshold:0.8,max_split_size_mb:512')
|
||||
os.environ.setdefault('CUDA_LAUNCH_BLOCKING', '0')
|
||||
os.environ.setdefault('CUDA_CACHE_DISABLE', '0')
|
||||
os.environ.setdefault('CUDA_AUTO_BOOST', '1')
|
||||
os.environ.setdefault('CUDA_MODULE_LOADING', 'LAZY')
|
||||
os.environ.setdefault('CUDA_CACHE_DISABLE', '0')
|
||||
os.environ.setdefault('CUDA_DEVICE_DEFAULT_PERSISTING_L2_CACHE_PERCENTAGE_LIMIT', '0')
|
||||
os.environ.setdefault('CUDA_LAUNCH_BLOCKING', '0')
|
||||
os.environ.setdefault('CUDA_MODULE_LOADING', 'LAZY')
|
||||
os.environ.setdefault('FORCE_CUDA', '1')
|
||||
os.environ.setdefault('GRADIO_ANALYTICS_ENABLED', 'False')
|
||||
os.environ.setdefault('SAFETENSORS_FAST_GPU', '1')
|
||||
os.environ.setdefault('HF_HUB_DISABLE_EXPERIMENTAL_WARNING', '1')
|
||||
os.environ.setdefault('HF_HUB_DISABLE_TELEMETRY', '1')
|
||||
os.environ.setdefault('K_DIFFUSION_USE_COMPILE', '0')
|
||||
os.environ.setdefault('NUMEXPR_MAX_THREADS', '16')
|
||||
os.environ.setdefault('PYTHONHTTPSVERIFY', '0')
|
||||
os.environ.setdefault('HF_HUB_DISABLE_TELEMETRY', '1')
|
||||
os.environ.setdefault('HF_HUB_DISABLE_EXPERIMENTAL_WARNING', '1')
|
||||
os.environ.setdefault('UVICORN_TIMEOUT_KEEP_ALIVE', '60')
|
||||
os.environ.setdefault('K_DIFFUSION_USE_COMPILE', '0')
|
||||
os.environ.setdefault('PYTORCH_CUDA_ALLOC_CONF', 'garbage_collection_threshold:0.8,max_split_size_mb:512')
|
||||
os.environ.setdefault('SAFETENSORS_FAST_GPU', '1')
|
||||
os.environ.setdefault('TF_CPP_MIN_LOG_LEVEL', '2')
|
||||
os.environ.setdefault('TF_ENABLE_ONEDNN_OPTS', '0')
|
||||
os.environ.setdefault('USE_TORCH', '1')
|
||||
os.environ.setdefault('UVICORN_TIMEOUT_KEEP_ALIVE', '60')
|
||||
if sys.platform == 'darwin':
|
||||
os.environ.setdefault('PYTORCH_ENABLE_MPS_FALLBACK', '1')
|
||||
|
||||
|
||||
@@ -39,7 +39,10 @@ async function createSplash() {
|
||||
document.getElementById('splash').insertAdjacentHTML('afterbegin', imgEl);
|
||||
fetch('/sdapi/v1/motd')
|
||||
.then((res) => res.text())
|
||||
.then((text) => document.getElementById('motd').innerHTML = text.replace(/["]+/g, ''))
|
||||
.then((text) => {
|
||||
const motdEl = document.getElementById('motd');
|
||||
if (motdEl) motdEl.innerHTML = text.replace(/["]+/g, '');
|
||||
})
|
||||
.catch((err) => console.error('getMOTD:', err));
|
||||
}
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ async function initLogMonitor() {
|
||||
<table id="logMonitor" style="width: 100%;">
|
||||
<thead style="display: block; text-align: left; border-bottom: solid 1px var(--button-primary-border-color)">
|
||||
<tr>
|
||||
<th style="width: 170px">Time</th>
|
||||
<th style="width: 160px">Time</th>
|
||||
<th>Level</th>
|
||||
<th style="width: 72px">Facility</th>
|
||||
<th style="width: 124px">Module</th>
|
||||
|
||||
@@ -94,7 +94,8 @@ div#extras_scale_to_tab div.form{ flex-direction: row; }
|
||||
#mode_img2img .gradio-image > div.fixed-height, #mode_img2img .gradio-image > div.fixed-height img{ height: 480px !important; max-height: 480px !important; min-height: 480px !important; }
|
||||
#img2img_sketch, #img2maskimg, #inpaint_sketch { overflow: overlay !important; resize: auto; background: var(--panel-background-fill); z-index: 5; }
|
||||
.image-buttons button{ min-width: auto; }
|
||||
.infotext { overflow-wrap: break-word; }
|
||||
.infotext { overflow-wrap: break-word; line-height: 1.5em; }
|
||||
.infotext > p { padding-left: 1em; text-indent: -1em; }
|
||||
.tooltip { display: block; position: fixed; top: 1em; right: 1em; padding: 0.5em; background: var(--input-background-fill); color: var(--body-text-color); border: 1pt solid var(--button-primary-border-color);
|
||||
width: 22em; min-height: 1.3em; font-size: 0.8em; transition: opacity 0.2s ease-in; pointer-events: none; opacity: 0; z-index: 999; }
|
||||
.tooltip-show { opacity: 0.9; }
|
||||
|
||||
@@ -233,7 +233,7 @@ if __name__ == "__main__":
|
||||
if round(time.time()) % 120 == 0:
|
||||
state = f'job="{instance.state.job}" {instance.state.job_no}/{instance.state.job_count}' if instance.state.job != '' or instance.state.job_no != 0 or instance.state.job_count != 0 else 'idle'
|
||||
uptime = round(time.time() - instance.state.server_start)
|
||||
installer.log.debug(f'Server: alive={alive} jobs={instance.state.total_jobs} requests={requests} uptime={uptime} memory={get_memory_stats()} backend={instance.backend} {state}')
|
||||
installer.log.debug(f'Server: alive={alive} jobs={instance.state.total_jobs} requests={requests} uptime={uptime} memory={get_memory_stats()} backend={instance.backend} state={state}')
|
||||
if not alive:
|
||||
if uv is not None and uv.wants_restart:
|
||||
installer.log.info('Server restarting...')
|
||||
|
||||
+5
-7
@@ -18,10 +18,8 @@ import piexif.helper
|
||||
from PIL import Image, ImageFont, ImageDraw, PngImagePlugin, ExifTags
|
||||
from modules import sd_samplers, shared, script_callbacks, errors, paths
|
||||
|
||||
LANCZOS = (Image.Resampling.LANCZOS if hasattr(Image, 'Resampling') else Image.LANCZOS)
|
||||
|
||||
debug = errors.log.info if os.environ.get('SD_PATH_DEBUG', None) is not None else lambda *args, **kwargs: None
|
||||
|
||||
|
||||
try:
|
||||
from pi_heif import register_heif_opener
|
||||
register_heif_opener()
|
||||
@@ -143,8 +141,8 @@ def draw_grid_annotations(im, width, height, hor_texts, ver_texts, margin=0, tit
|
||||
for line in lines:
|
||||
font = initial_fnt
|
||||
fontsize = initial_fontsize
|
||||
while drawing.multiline_textsize(line.text, font=font)[0] > line.allowed_width and fontsize > 0:
|
||||
fontsize -= 2
|
||||
while drawing.multiline_textbbox((0,0), text=line.text, font=font)[0] > line.allowed_width and fontsize > 0:
|
||||
fontsize -= 1
|
||||
font = get_font(fontsize)
|
||||
drawing.multiline_text((draw_x, draw_y + line.size[1] / 2), line.text, font=font, fill=shared.opts.font_color if line.is_active else color_inactive, anchor="mm", align="center")
|
||||
if not line.is_active:
|
||||
@@ -230,7 +228,7 @@ def resize_image(resize_mode, im, width, height, upscaler_name=None, output_type
|
||||
|
||||
def resize(im, w, h):
|
||||
if upscaler_name is None or upscaler_name == "None" or im.mode == 'L':
|
||||
return im.resize((w, h), resample=LANCZOS)
|
||||
return im.resize((w, h), resample=Image.Resampling.LANCZOS)
|
||||
scale = max(w / im.width, h / im.height)
|
||||
if scale > 1.0:
|
||||
upscalers = [x for x in shared.sd_upscalers if x.name == upscaler_name]
|
||||
@@ -241,7 +239,7 @@ def resize_image(resize_mode, im, width, height, upscaler_name=None, output_type
|
||||
upscaler = upscalers[0]
|
||||
im = upscaler.scaler.upscale(im, scale, upscaler.data_path)
|
||||
if im.width != w or im.height != h:
|
||||
im = im.resize((w, h), resample=LANCZOS)
|
||||
im = im.resize((w, h), resample=Image.Resampling.LANCZOS)
|
||||
return im
|
||||
|
||||
if resize_mode == 0:
|
||||
|
||||
@@ -42,16 +42,14 @@ def process_diffusers(p: StableDiffusionProcessing, seeds, prompts, negative_pro
|
||||
if latent_upscaler is not None:
|
||||
latents = torch.nn.functional.interpolate(latents, size=(p.hr_upscale_to_y // 8, p.hr_upscale_to_x // 8), mode=latent_upscaler["mode"], antialias=latent_upscaler["antialias"])
|
||||
first_pass_images = vae_decode(latents=latents, model=shared.sd_model, full_quality=p.full_quality, output_type='pil')
|
||||
p.init_images = []
|
||||
resized_images = []
|
||||
for img in first_pass_images:
|
||||
if latent_upscaler is None:
|
||||
init_image = images.resize_image(1, img, p.hr_upscale_to_x, p.hr_upscale_to_y, upscaler_name=p.hr_upscaler)
|
||||
resized_image = images.resize_image(1, img, p.hr_upscale_to_x, p.hr_upscale_to_y, upscaler_name=p.hr_upscaler)
|
||||
else:
|
||||
init_image = img
|
||||
# if is_refiner_enabled:
|
||||
# init_image = vae_encode(init_image, model=shared.sd_model, full_quality=p.full_quality)
|
||||
p.init_images.append(init_image)
|
||||
return p.init_images
|
||||
resized_image = img
|
||||
resized_images.append(resized_image)
|
||||
return resized_images
|
||||
|
||||
def save_intermediate(latents, suffix):
|
||||
for i in range(len(latents)):
|
||||
@@ -470,7 +468,6 @@ def process_diffusers(p: StableDiffusionProcessing, seeds, prompts, negative_pro
|
||||
desc='Base',
|
||||
)
|
||||
shared.state.sampling_steps = base_args['num_inference_steps']
|
||||
p.extra_generation_params['CFG rescale'] = p.diffusers_guidance_rescale
|
||||
p.extra_generation_params["Sampler Eta"] = shared.opts.scheduler_eta if shared.opts.scheduler_eta is not None and shared.opts.scheduler_eta > 0 and shared.opts.scheduler_eta < 1 else None
|
||||
try:
|
||||
output = shared.sd_model(**base_args) # pylint: disable=not-callable
|
||||
@@ -490,7 +487,7 @@ def process_diffusers(p: StableDiffusionProcessing, seeds, prompts, negative_pro
|
||||
return results
|
||||
|
||||
# optional hires pass
|
||||
if p.enable_hr and p.hr_upscaler != 'None' and p.denoising_strength > 0 and len(getattr(p, 'init_images', [])) == 0:
|
||||
if p.enable_hr and getattr(p, 'hr_upscaler', 'None') != 'None' and len(getattr(p, 'init_images', [])) == 0:
|
||||
p.is_hr_pass = True
|
||||
latent_scale_mode = shared.latent_upscale_modes.get(p.hr_upscaler, None) if (hasattr(p, "hr_upscaler") and p.hr_upscaler is not None) else shared.latent_upscale_modes.get(shared.latent_upscale_default_mode, "None")
|
||||
if p.is_hr_pass:
|
||||
@@ -502,7 +499,7 @@ def process_diffusers(p: StableDiffusionProcessing, seeds, prompts, negative_pro
|
||||
save_intermediate(latents=output.images, suffix="-before-hires")
|
||||
shared.state.job = 'upscale'
|
||||
output.images = hires_resize(latents=output.images)
|
||||
if latent_scale_mode is not None or p.hr_force:
|
||||
if (latent_scale_mode is not None or p.hr_force) and p.denoising_strength > 0:
|
||||
p.ops.append('hires')
|
||||
shared.sd_model = sd_models.set_diffuser_pipe(shared.sd_model, sd_models.DiffusersTaskType.IMAGE_2_IMAGE)
|
||||
recompile_model(hires=True)
|
||||
@@ -519,7 +516,7 @@ def process_diffusers(p: StableDiffusionProcessing, seeds, prompts, negative_pro
|
||||
guidance_rescale=p.diffusers_guidance_rescale,
|
||||
output_type='latent' if hasattr(shared.sd_model, 'vae') else 'np',
|
||||
clip_skip=p.clip_skip,
|
||||
image=p.init_images,
|
||||
image=output.images,
|
||||
strength=p.denoising_strength,
|
||||
desc='Hires',
|
||||
)
|
||||
|
||||
+13
-11
@@ -595,51 +595,52 @@ def change_backend():
|
||||
refresh_vae_list()
|
||||
|
||||
|
||||
def detect_pipeline(f: str, op: str = 'model'):
|
||||
def detect_pipeline(f: str, op: str = 'model', warning=True):
|
||||
if not f.endswith('.safetensors'):
|
||||
return None, None
|
||||
guess = shared.opts.diffusers_pipeline
|
||||
warn = shared.log.warning if warning else lambda *args, **kwargs: None
|
||||
if guess == 'Autodetect':
|
||||
try:
|
||||
size = round(os.path.getsize(f) / 1024 / 1024)
|
||||
if size < 128:
|
||||
shared.log.warning(f'Model size smaller than expected: {f} size={size} MB')
|
||||
warn(f'Model size smaller than expected: {f} size={size} MB')
|
||||
elif (size >= 316 and size <= 324) or (size >= 156 and size <= 164): # 320 or 160
|
||||
shared.log.warning(f'Model detected as VAE model, but attempting to load as model: {op}={f} size={size} MB')
|
||||
warn(f'Model detected as VAE model, but attempting to load as model: {op}={f} size={size} MB')
|
||||
guess = 'VAE'
|
||||
elif size >= 5351 and size <= 5359: # 5353
|
||||
guess = 'Stable Diffusion' # SD v2
|
||||
elif size >= 5791 and size <= 5799: # 5795
|
||||
if shared.backend == shared.Backend.ORIGINAL:
|
||||
shared.log.warning(f'Model detected as SD-XL refiner model, but attempting to load using backend=original: {op}={f} size={size} MB')
|
||||
warn(f'Model detected as SD-XL refiner model, but attempting to load using backend=original: {op}={f} size={size} MB')
|
||||
if op == 'model':
|
||||
shared.log.warning(f'Model detected as SD-XL refiner model, but attempting to load a base model: {op}={f} size={size} MB')
|
||||
warn(f'Model detected as SD-XL refiner model, but attempting to load a base model: {op}={f} size={size} MB')
|
||||
guess = 'Stable Diffusion XL'
|
||||
elif (size >= 6611 and size <= 6619) or (size >= 6771 and size <= 6779): # 6617, HassakuXL is 6776
|
||||
if shared.backend == shared.Backend.ORIGINAL:
|
||||
shared.log.warning(f'Model detected as SD-XL base model, but attempting to load using backend=original: {op}={f} size={size} MB')
|
||||
warn(f'Model detected as SD-XL base model, but attempting to load using backend=original: {op}={f} size={size} MB')
|
||||
guess = 'Stable Diffusion XL'
|
||||
elif size >= 3361 and size <= 3369: # 3368
|
||||
if shared.backend == shared.Backend.ORIGINAL:
|
||||
shared.log.warning(f'Model detected as SD upscale model, but attempting to load using backend=original: {op}={f} size={size} MB')
|
||||
warn(f'Model detected as SD upscale model, but attempting to load using backend=original: {op}={f} size={size} MB')
|
||||
guess = 'Stable Diffusion Upscale'
|
||||
elif size >= 4891 and size <= 4899: # 4897
|
||||
if shared.backend == shared.Backend.ORIGINAL:
|
||||
shared.log.warning(f'Model detected as SD XL inpaint model, but attempting to load using backend=original: {op}={f} size={size} MB')
|
||||
warn(f'Model detected as SD XL inpaint model, but attempting to load using backend=original: {op}={f} size={size} MB')
|
||||
guess = 'Stable Diffusion XL Inpaint'
|
||||
elif size >= 9791 and size <= 9799: # 9794
|
||||
if shared.backend == shared.Backend.ORIGINAL:
|
||||
shared.log.warning(f'Model detected as SD XL instruct pix2pix model, but attempting to load using backend=original: {op}={f} size={size} MB')
|
||||
warn(f'Model detected as SD XL instruct pix2pix model, but attempting to load using backend=original: {op}={f} size={size} MB')
|
||||
guess = 'Stable Diffusion XL Instruct'
|
||||
else:
|
||||
guess = 'Stable Diffusion'
|
||||
if 'LCM_' in f or 'LCM-' in f:
|
||||
if shared.backend == shared.Backend.ORIGINAL:
|
||||
shared.log.warning(f'Model detected as LCM model, but attempting to load using backend=original: {op}={f} size={size} MB')
|
||||
warn(f'Model detected as LCM model, but attempting to load using backend=original: {op}={f} size={size} MB')
|
||||
guess = 'Latent Consistency Model'
|
||||
if 'PixArt' in f:
|
||||
if shared.backend == shared.Backend.ORIGINAL:
|
||||
shared.log.warning(f'Model detected as PixArt Alpha model, but attempting to load using backend=original: {op}={f} size={size} MB')
|
||||
warn(f'Model detected as PixArt Alpha model, but attempting to load using backend=original: {op}={f} size={size} MB')
|
||||
guess = 'PixArt Alpha'
|
||||
pipeline = shared_items.get_pipelines().get(guess, None)
|
||||
shared.log.info(f'Autodetect: {op}="{guess}" class={pipeline.__name__} file="{f}" size={size}MB')
|
||||
@@ -1087,6 +1088,7 @@ def load_model(checkpoint_info=None, already_loaded_state_dict=None, timer=None,
|
||||
shared.log.debug(f"Model created from config: {checkpoint_config}")
|
||||
sd_model.used_config = checkpoint_config
|
||||
sd_model.has_accelerate = False
|
||||
sd_model.is_sdxl = False # a1111 compatibility item
|
||||
timer.record("create")
|
||||
ok = load_model_weights(sd_model, checkpoint_info, state_dict, timer)
|
||||
if not ok:
|
||||
|
||||
@@ -76,6 +76,9 @@ def compile_stablefast(sd_model):
|
||||
warnings.filterwarnings("ignore", category=torch.jit.TracerWarning)
|
||||
config.enable_cuda_graph = shared.opts.cuda_compile_fullgraph
|
||||
config.enable_jit_freeze = shared.opts.diffusers_eval
|
||||
config.memory_format = torch.channels_last if shared.opts.opt_channelslast else torch.contiguous_format
|
||||
# config.enable_cnn_optimization
|
||||
# config.prefer_lowp_gemm
|
||||
try:
|
||||
t0 = time.time()
|
||||
sd_model = sf.compile(sd_model, config)
|
||||
|
||||
+1
-1
@@ -307,7 +307,7 @@ options_templates.update(options_section(('cuda', "Compute Settings"), {
|
||||
"cuda_compile_vae": OptionInfo(True if cmd_opts.use_openvino else False, "Compile VAE"),
|
||||
"cuda_compile_upscaler": OptionInfo(True if cmd_opts.use_openvino else False, "Compile upscaler"),
|
||||
"cuda_compile_backend": OptionInfo("openvino_fx" if cmd_opts.use_openvino else "none", "Model compile backend", gr.Radio, {"choices": ['none', 'inductor', 'cudagraphs', 'aot_ts_nvfuser', 'hidet', 'ipex', 'openvino_fx', 'stable-fast']}),
|
||||
"cuda_compile_mode": OptionInfo("default", "Model compile mode", gr.Radio, {"choices": ['default', 'reduce-overhead', 'max-autotune']}),
|
||||
"cuda_compile_mode": OptionInfo("default", "Model compile mode", gr.Radio, {"choices": ['default', 'reduce-overhead', 'max-autotune', 'max-autotune-no-cudagraphs']}),
|
||||
"cuda_compile_fullgraph": OptionInfo(False, "Model compile fullgraph"),
|
||||
"cuda_compile_precompile": OptionInfo(False if cmd_opts.use_openvino else True, "Model compile precompile"),
|
||||
"cuda_compile_verbose": OptionInfo(False, "Model compile verbose mode"),
|
||||
|
||||
+14
-7
@@ -6,7 +6,7 @@ import platform
|
||||
import subprocess
|
||||
import gradio as gr
|
||||
from modules import call_queue, shared
|
||||
from modules.generation_parameters_copypaste import image_from_url_text
|
||||
from modules.generation_parameters_copypaste import image_from_url_text, parse_generation_parameters
|
||||
import modules.ui_symbols as symbols
|
||||
import modules.images
|
||||
import modules.script_callbacks
|
||||
@@ -34,12 +34,19 @@ def plaintext_to_html(text):
|
||||
|
||||
|
||||
def infotext_to_html(text):
|
||||
res = '<p class="html_info">Prompt: ' + html.escape(text or '').replace('\n', '<br>') + '</p>'
|
||||
sections = res.split('Steps:') # before and after prompt+negprompt'
|
||||
if len(sections) > 1:
|
||||
res = sections[0] + '<br>Steps: ' + sections[1].strip().replace(', ', ' | ')
|
||||
res = res.replace('<br><br>', '<br>')
|
||||
return res
|
||||
res = parse_generation_parameters(text)
|
||||
prompt = res.get('Prompt', None)
|
||||
negative = res.get('Negative prompt', None)
|
||||
res.pop('Prompt', None)
|
||||
res.pop('Negative prompt', None)
|
||||
params = [f'{k}: {v}' for k, v in res.items() if v is not None]
|
||||
params = '| '.join(params)
|
||||
code = f'''
|
||||
<p><b>Prompt:</b> {prompt}</p>
|
||||
<p><b>Negative:</b> {negative}</p>
|
||||
<p><b>Parameters:</b> {params}</p>
|
||||
'''
|
||||
return code
|
||||
|
||||
|
||||
def delete_files(js_data, images, _html_info, index):
|
||||
|
||||
+1
-1
@@ -228,7 +228,7 @@ def compile_upscaler(model, name=""):
|
||||
|
||||
if modules.shared.opts.cuda_compile_backend == "openvino_fx":
|
||||
from modules.intel.openvino import openvino_fx # pylint: disable=unused-import
|
||||
from modules.sd_models_compile import CompiledModelState
|
||||
from modules.sd_models_compile import CompiledModelState # pylint: disable=unused-import
|
||||
torch._dynamo.eval_frame.check_if_dynamo_supported = lambda: True # pylint: disable=protected-access
|
||||
|
||||
log_level = logging.WARNING if modules.shared.opts.cuda_compile_verbose else logging.CRITICAL # pylint: disable=protected-access
|
||||
|
||||
+3
-3
@@ -51,10 +51,10 @@ requests==2.31.0
|
||||
tqdm==4.66.1
|
||||
accelerate==0.20.3
|
||||
opencv-python-headless==4.7.0.72
|
||||
diffusers==0.23.0
|
||||
diffusers==0.23.1
|
||||
einops==0.4.1
|
||||
gradio==3.43.2
|
||||
huggingface_hub==0.19.2
|
||||
huggingface_hub==0.19.4
|
||||
numexpr==2.8.4
|
||||
numpy==1.24.4
|
||||
numba==0.57.1
|
||||
@@ -64,7 +64,7 @@ pytorch_lightning==1.9.4
|
||||
transformers==4.35.1
|
||||
tomesd==0.1.3
|
||||
urllib3==1.26.15
|
||||
Pillow==9.5.0
|
||||
Pillow==10.1.0
|
||||
timm==0.9.7
|
||||
pydantic==1.10.13
|
||||
typing-extensions==4.8.0
|
||||
|
||||
@@ -248,7 +248,7 @@ def start_ui():
|
||||
for line in file.readlines():
|
||||
gradio_auth_creds += [x.strip() for x in line.split(',') if x.strip()]
|
||||
if len(gradio_auth_creds) > 0:
|
||||
log.info(f'Authentication enabled: {gradio_auth_creds}')
|
||||
log.info(f'Authentication enabled: users={len(list(gradio_auth_creds))}')
|
||||
|
||||
global local_url # pylint: disable=global-statement
|
||||
stdout = io.StringIO()
|
||||
|
||||
Reference in New Issue
Block a user