mirror of
https://github.com/vladmandic/automatic
synced 2026-09-19 09:14:35 +02:00
fix grid with lora, add dlss framgen logging, add 8bit minimax variants
Signed-off-by: Vladimir Mandic <mandic00@live.com>
This commit is contained in:
@@ -154,7 +154,7 @@ def get_font(fontsize: float):
|
||||
def draw_grid_annotations(im: Image.Image, width: int, height: int, x_texts: list[list[GridAnnotation]], y_texts: list[list[GridAnnotation]], margin=0, title: list[GridAnnotation] | None = None):
|
||||
def wrap(drawing: ImageDraw.ImageDraw, text, font, line_length):
|
||||
lines = ['']
|
||||
for word in text.split():
|
||||
for word in text.split('/\\'):
|
||||
line = f'{lines[-1]} {word}'.strip()
|
||||
if drawing.textlength(line, font=font) <= line_length:
|
||||
lines[-1] = line
|
||||
@@ -162,7 +162,7 @@ def draw_grid_annotations(im: Image.Image, width: int, height: int, x_texts: lis
|
||||
lines.append(word)
|
||||
return lines
|
||||
|
||||
def draw_texts(drawing: ImageDraw.ImageDraw, draw_x: float, draw_y: float, lines, initial_fnt: ImageFont.FreeTypeFont, initial_fontsize: int):
|
||||
def draw_texts(drawing: ImageDraw.ImageDraw, draw_x: float, draw_y: float, lines: list[GridAnnotation], initial_fnt: ImageFont.FreeTypeFont, initial_fontsize: int):
|
||||
for line in lines:
|
||||
font = initial_fnt
|
||||
fontsize = initial_fontsize
|
||||
|
||||
@@ -322,6 +322,8 @@ def network_load(names, te_multipliers=None, unet_multipliers=None, dyn_dims=Non
|
||||
if net is None:
|
||||
failed_to_load_networks.append(name)
|
||||
lora_ver = network_on_disk.sd_version if network_on_disk is not None else None
|
||||
if lora_ver is None or len(lora_ver) == 0:
|
||||
lora_ver = "unknown"
|
||||
log.error(f'Network load: type=LoRA name="{name}" detected={lora_ver} not loaded')
|
||||
continue
|
||||
if hasattr(sd_model, 'embedding_db'):
|
||||
|
||||
@@ -39,6 +39,8 @@ def modular_step(components: diffusers.modular_pipelines.ModularPipeline, state:
|
||||
|
||||
|
||||
def modular_intercept(self, components, state: diffusers.modular_pipelines.modular_pipeline.BlockState, *args, **kwargs):
|
||||
if shared.state.interrupted or shared.state.skipped:
|
||||
raise AssertionError('Interrupted...')
|
||||
t0 = time.time()
|
||||
block = type(self).__name__
|
||||
# run code before block call
|
||||
@@ -117,6 +119,8 @@ def install_state_hook(pipe):
|
||||
|
||||
def set_phase(phase: str, module: torch.nn.Module | None = None):
|
||||
# every stage runs inside one pipeline call, so the forward hooks are the only place the current stage is visible
|
||||
if shared.state.interrupted or shared.state.skipped:
|
||||
raise AssertionError('Interrupted...')
|
||||
if getattr(pipe, 'sdnext_phase', None) != phase:
|
||||
pipe.sdnext_phase = phase
|
||||
jobid = getattr(pipe, 'sdnext_phaseid', None) # previous jobid if any
|
||||
|
||||
Reference in New Issue
Block a user