mirror of
https://github.com/vladmandic/automatic
synced 2026-09-20 01:31:13 +02:00
swtich to igwn-segments
Signed-off-by: Vladimir Mandic <mandic00@live.com>
This commit is contained in:
@@ -69,6 +69,7 @@
|
||||
- log: processing stats reporting
|
||||
- metadata: image metadata handle correct image index
|
||||
- gguf: transformer loader
|
||||
- scripts: mixture-of-diffusers and mixture-tiling update to use igwn-segments
|
||||
|
||||
## Update for 2026-08-07
|
||||
|
||||
|
||||
@@ -823,8 +823,8 @@ def control_run(state: str = '', # pylint: disable=keyword-arg-before-vararg
|
||||
|
||||
debug_log(f'Control: pipeline units={len(active_model)} process={len(active_process)} outputs={len(output_images)}')
|
||||
except Exception as e:
|
||||
log.error(f'Control: type={unit_type} units={len(active_model)} {e}')
|
||||
errors.display(e, 'Control')
|
||||
log.error(f'Generate: {e}')
|
||||
errors.display(e, 'Generate')
|
||||
|
||||
if len(output_images) == 0:
|
||||
output_images = None
|
||||
|
||||
@@ -69,9 +69,9 @@ class MoDScript(scripts_manager.Script):
|
||||
|
||||
def check_dependencies(self):
|
||||
from installer import install
|
||||
install('ligo-segments')
|
||||
install('igwn-segments')
|
||||
try:
|
||||
from ligo.segments import segment # pylint: disable=unused-import
|
||||
from igwn_segments import segment # pylint: disable=unused-import
|
||||
return True
|
||||
except Exception as e:
|
||||
log.error(f'MoD: {e}')
|
||||
|
||||
+12
-19
@@ -4,22 +4,6 @@ from modules import shared, devices, scripts_manager, processing, sd_models
|
||||
from modules.logger import log
|
||||
|
||||
|
||||
checked_ok = False
|
||||
|
||||
|
||||
def check_dependencies():
|
||||
global checked_ok # pylint: disable=global-statement
|
||||
from installer import install
|
||||
install('ligo-segments')
|
||||
try:
|
||||
from ligo.segments import segment # pylint: disable=unused-import
|
||||
checked_ok = True
|
||||
return True
|
||||
except Exception as e:
|
||||
log.error(f'Mixture tiling: {e}')
|
||||
return False
|
||||
|
||||
|
||||
class MixtureTilingScript(scripts_manager.Script):
|
||||
def title(self):
|
||||
return 'Mixture Tiling: Scene Composition'
|
||||
@@ -40,10 +24,19 @@ class MixtureTilingScript(scripts_manager.Script):
|
||||
y_overlap = gr.Slider(label='Y overlap', minimum=0, maximum=1, step=0.01, value=0.5)
|
||||
return x_size, y_size, x_overlap, y_overlap
|
||||
|
||||
def check_dependencies(self):
|
||||
from installer import install
|
||||
install('igwn-segments')
|
||||
try:
|
||||
from igwn_segments import segment # pylint: disable=unused-import
|
||||
return True
|
||||
except Exception as e:
|
||||
log.error(f'Mixture tiling: {e}')
|
||||
return False
|
||||
|
||||
def run(self, p: processing.StableDiffusionProcessing, x_size, y_size, x_overlap, y_overlap): # pylint: disable=arguments-differ
|
||||
if not checked_ok:
|
||||
if not check_dependencies():
|
||||
return None
|
||||
if not self.check_dependencies():
|
||||
return None
|
||||
prompts = p.prompt.splitlines()
|
||||
if len(prompts) != x_size * y_size:
|
||||
log.error(f'Mixture tiling prompt count mismatch: prompts={len(prompts)} required={x_size * y_size}')
|
||||
|
||||
@@ -52,9 +52,9 @@ from diffusers.utils.torch_utils import randn_tensor
|
||||
|
||||
|
||||
try:
|
||||
from ligo.segments import segment
|
||||
from igwn_segments import segment
|
||||
except ImportError as e:
|
||||
raise ImportError("Please install transformers and ligo-segments to use the mixture pipeline") from e
|
||||
raise ImportError("Please install transformers and igwn-segments to use the mixture pipeline") from e
|
||||
|
||||
if is_torch_xla_available():
|
||||
import torch_xla.core.xla_model as xm
|
||||
@@ -1138,7 +1138,9 @@ class StableDiffusionXLTilingPipeline(
|
||||
else guidance_scale_tiles[row][col]
|
||||
)
|
||||
noise_pred_tile = noise_pred_uncond + guidance * (noise_pred_text - noise_pred_uncond)
|
||||
noise_preds_row.append(noise_pred_tile)
|
||||
else:
|
||||
noise_pred_tile = noise_pred
|
||||
noise_preds_row.append(noise_pred_tile)
|
||||
noise_preds.append(noise_preds_row)
|
||||
|
||||
# Stitch noise predictions for all tiles
|
||||
|
||||
Reference in New Issue
Block a user