fix: dead hasattr-on-dict path, double video-vae normalization, undefined self.device, hyimage if/elif, attention-mask attr typo, wrong face logged

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
QualiaRain
2026-06-12 05:08:50 -04:00
parent 1cf715fac2
commit 8a8d99019a
6 changed files with 6 additions and 6 deletions
+1 -1
View File
@@ -240,7 +240,7 @@ def preprocess_image(
if 'strength' in possible:
p.task_args['strength'] = p.denoising_strength
p.init_images = [init_image] * len(active_model)
if hasattr(shared.sd_model, 'controlnet') and hasattr(p.task_args, 'control_image') and len(p.task_args['control_image']) > 1 and (shared.sd_model.__class__.__name__ == 'StableDiffusionXLControlNetUnionPipeline'): # special case for controlnet-union
if hasattr(shared.sd_model, 'controlnet') and 'control_image' in p.task_args and len(p.task_args['control_image']) > 1 and (shared.sd_model.__class__.__name__ == 'StableDiffusionXLControlNetUnionPipeline'): # special case for controlnet-union
p.task_args['control_image'] = [[x] for x in p.task_args['control_image']]
p.task_args['control_mode'] = [[x] for x in p.task_args['control_mode']]
+1 -1
View File
@@ -35,7 +35,7 @@ def instant_id(p: processing.StableDiffusionProcessing, app, source_images, stre
face = sorted(faces, key=lambda x:(x['bbox'][2]-x['bbox'][0])*x['bbox'][3]-x['bbox'][1])[-1] # only use the maximum face
face_embeds.append(torch.from_numpy(face['embedding']))
face_images.append(draw_kps(source_image, face['kps']))
p.extra_generation_params[f"InstantID {i+1}"] = f'{faces[0].det_score:.2f} {"female" if faces[0].gender==0 else "male"} {faces[0].age}y'
p.extra_generation_params[f"InstantID {i+1}"] = f'{face.det_score:.2f} {"female" if face.gender==0 else "male"} {face.age}y'
log.debug(f'InstantID face: score={face.det_score:.2f} gender={"female" if face.gender==0 else "male"} age={face.age} bbox={face.bbox}')
log.debug(f'InstantID loading: model={REPO_ID}')
+1
View File
@@ -27,6 +27,7 @@ class UpscalerSeedVR(Upscaler):
]
self.model = None
self.model_loaded = None
self.device = devices.device
def load_model(self, path: str):
model_name = MODELS_MAP.get(path, None)
+1 -1
View File
@@ -633,7 +633,7 @@ class StableDiffusionProcessing:
self.negative_embeds = []
self.negative_pooleds = []
self.prompt_attention_masks = []
self.negative_prompt_attention_mask = []
self.negative_prompt_attention_masks = []
self.xyz = xyz
self.abort = False
-1
View File
@@ -50,5 +50,4 @@ def vae_decode_tiny(latents):
vae = vae.to(device=devices.device, dtype=devices.dtype)
latents = latents.transpose(1, 2).to(device=devices.device, dtype=devices.dtype)
images = vae.decode_video(latents, parallel=False).transpose(1, 2).mul_(2).sub_(1)
images = images.transpose(1, 2).mul_(2).sub_(1)
return (images, None)
+2 -2
View File
@@ -107,9 +107,9 @@ class HunyuanImage3Wrapper(torch.nn.Module):
if height is None and width is None:
image_size = "auto"
if height is None:
elif height is None:
image_size = (width, width)
if width is None:
elif width is None:
image_size = (height, height)
else:
image_size = (height, width)