1adrianb / 1adrianb/face-alignment

FaceAlignmentCropper

Abierto
#377 0 comentarios 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
Python
Estrellas
7.5k
Forks
1.4k
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

Issue / Note: PyTorch 2.6+ Security Blocks Weights Loading in FaceAlignmentCropper
Problem Description:
When running a workflow with the LivePortrait Load FaceAlignmentCropper node, it fails to initialize and turns red on the canvas (entering an UNKNOWN state or throwing an initialization error). The ComfyUI console outputs a critical PyTorch serialization error.

Error Log:

Plaintext
torch.serialization.WeightsOnlyLoadFailed: Weights only load failed. Re-running `torch.load` with `weights_only=False` to show an exception that happened instead has failed.
AttributeError: Can't get attribute 'reduce_graph_module' on

Root Cause:
Starting with PyTorch 2.6+, the default model loading mechanism strictly enforces security restrictions (weights_only=True). This blocks the execution of any hidden or non-standard code embedded within model weight files. The checkpoint used by the FaceAlignment backend was saved using an outdated method and contains a reference to an internal structure called reduce_graph_module. The updated PyTorch environment flags this structure as unsafe and completely blocks its import.

Solution / Workaround:
Switch to the LivePortrait Load InsightFaceCropper node. It utilizes modern models in the .onnx format, which run via a separate ONNX Runtime engine. This completely bypasses PyTorch's pickle-based security checks, prevents initialization errors, and provides significantly more precise facial tracking utilizing GPU acceleration (CUDA) RTX 4080.

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Línea de trabajo

The issue is in the model loading mechanism for PyTorch 2.6+. Examine the checkpoint loading code in the face-alignment library, likely around where torch.load is called. The error references 'reduce_graph_module'. Check if the model checkpoint format needs updating or if weights_only must be set to False. Testing requires a PyTorch 2.6+ environment and the failing checkpoint.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
python, pytorch
Área
ai, machine-learning
Tipo de issue
Error
Dificultad
4/5
Tiempo estimado
3-5 días
Estado de actividad
Tranquilo
Claridad
Bien especificado
Aptitud para principiantes
30/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.