fix img2img batch

This commit is contained in:
Vladimir Mandic
2024-01-29 08:34:36 -05:00
parent 157ddd2ad2
commit 753bfebe1c
7 changed files with 15 additions and 17 deletions
+2 -2
View File
@@ -16,7 +16,7 @@ OPTIONAL:
- masking api
- preprocess api
## Update for 2023-01-28
## Update for 2023-01-29
Another big release, highlights being:
- A lot more functionality in the **Control** module:
@@ -141,7 +141,7 @@ As of this release, default backend is set to **diffusers** as its more feature
- modularized blip/booru interrogate
now appears as toolbuttons on image/gallery output
- faster browser page load
- cleanup hints
- cleanup hints, thanks @brknsoul
- cleanup settings
- **server**
- all move/offload options are disable by default for optimal performance
-4
View File
@@ -23,10 +23,6 @@
.livePreview img { position: absolute; object-fit: contain; width: 100%; height: 100%; }
.dark .livePreview { background-color: rgb(17 24 39 / var(--tw-bg-opacity)); }
.popup-metadata { color: white; background: #0000; display: inline-block; white-space: pre-wrap; font-size: 0.75em; }
.global-popup{ display: flex; position: fixed; z-index: 10001; left: 0; top: 0; width: 100%; height: 100%; overflow: auto; background-color: rgba(20, 20, 20, 0.95);}
.global-popup-close:before { content: "×"; }
.global-popup-close{ position: fixed; right: 0.5em; top: 0; cursor: pointer; color: white; font-size: 32pt; }
.global-popup-inner{ display: inline-block; margin: auto; padding: 2em; }
/* fullpage image viewer */
#lightboxModal{ display: none; position: fixed; z-index: 1001; left: 0; top: 0; width: 100%; height: 100%; overflow: auto; background-color: rgba(20, 20, 20, 0.75); backdrop-filter: blur(6px);
+1 -4
View File
@@ -33,10 +33,7 @@ async function setupControlUI() {
const name = tab.innerText.toLowerCase();
for (let i = 0; i < 10; i += 1) {
const btn = gradioApp().getElementById(`refresh_${name}_models_${i}`);
if (btn) {
btn.click();
console.log('HERE', `refresh_${name}_models_${i}`);
}
if (btn) btn.click();
}
}
}
-4
View File
@@ -145,10 +145,6 @@ div#extras_scale_to_tab div.form{ flex-direction: row; }
.livePreview img { position: absolute; object-fit: contain; width: 100%; height: 100%; }
.dark .livePreview { background-color: rgb(17 24 39 / var(--tw-bg-opacity)); }
.popup-metadata { color: white; background: #0000; display: inline-block; white-space: pre-wrap; font-size: var(--text-xxs); }
.global-popup{ display: flex; position: fixed; z-index: 10001; left: 0; top: 0; width: 100%; height: 100%; overflow: auto; background-color: rgba(20, 20, 20, 0.95);}
.global-popup-close:before { content: "×"; }
.global-popup-close{ position: fixed; right: 0.5em; top: 0; cursor: pointer; color: white; font-size: 32pt; }
.global-popup-inner{ display: inline-block; margin: auto; padding: 2em; }
/* fullpage image viewer */
#lightboxModal{ display: none; position: fixed; z-index: 1001; left: 0; top: 0; width: 100%; height: 100%; overflow: auto; background-color: rgba(20, 20, 20, 0.75); backdrop-filter: blur(6px);
+2
View File
@@ -23,9 +23,11 @@ def process_batch(p, input_files, input_dir, output_dir, inpaint_mask_dir, args)
shared.log.error(f"Process batch: directory not found: {input_dir}")
return
image_files = os.listdir(input_dir)
image_files = [os.path.join(input_dir, f) for f in image_files]
is_inpaint_batch = False
if inpaint_mask_dir:
inpaint_masks = os.listdir(inpaint_mask_dir)
inpaint_masks = [os.path.join(inpaint_mask_dir, f) for f in inpaint_masks]
is_inpaint_batch = len(inpaint_masks) > 0
if is_inpaint_batch:
shared.log.info(f"Process batch: inpaint batch masks={len(inpaint_masks)}")
+9 -2
View File
@@ -1,9 +1,12 @@
import os
import psutil
import torch
from modules import shared
from modules import shared, errors
fail_once = False
def memory_stats():
global fail_once # pylint: disable=global-statement
def gb(val: float):
return round(val / 1024 / 1024 / 1024, 2)
@@ -15,7 +18,11 @@ def memory_stats():
ram = { 'used': gb(res.rss), 'total': gb(ram_total) }
mem.update({ 'ram': ram })
except Exception as e:
mem.update({ 'ram': e })
if not fail_once:
shared.log.error('Memory stats: {e}')
errors.display(e, 'Memory stats')
fail_once = True
mem.update({ 'ram': str(e) })
try:
s = torch.cuda.mem_get_info()
gpu = { 'used': gb(s[1] - s[0]), 'total': gb(s[1]) }