From 0a3d986cb94a39d1b1d41f5877ba410d0137e1e4 Mon Sep 17 00:00:00 2001 From: Kaski <23-23enterprise@gmx.de> Date: Wed, 5 Nov 2025 16:08:06 +0100 Subject: [PATCH] Comments to english --- normal_crafter_nodes.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/normal_crafter_nodes.py b/normal_crafter_nodes.py index 7c09819..42ddb9e 100644 --- a/normal_crafter_nodes.py +++ b/normal_crafter_nodes.py @@ -305,14 +305,14 @@ class NormalCrafterNode: imgs = images.to(device, non_blocking=True).permute(0, 3, 1, 2) # (B,C,H,W) _, _, H, W = imgs.shape - # 1. Erst mal auf max_res_dim runterskalieren (falls nötig) + # 1. Scale down to max_res_dim (if necessary if max(H, W) > max_res_dim: scale = max_res_dim / max(H, W) target_h, target_w = int(round(H * scale)), int(round(W * scale)) else: target_h, target_w = H, W - # 2. Attention-Safe-Dimensionen erzwingen (Vielfaches von 8, min 16) + # 2. Enforce Attention-Safe-Dimension (minimum 64) min_dim = 64 align = 64 target_h = max(min_dim, ((target_h + align - 1) // align) * align) @@ -362,7 +362,7 @@ class NormalCrafterNode: orig_h, orig_w = images.shape[1:3] resized_tensor = self.make_safe_size(images, max_res_dimension, processing_device) - # Anzahl Frames aus Tensor bestimmen + # Get number of frames in the tensor num_actual_frames = resized_tensor.shape[0] @@ -457,11 +457,11 @@ class NormalCrafterNode: output_frames_pt = output_frames_pt[:num_actual_frames, ...] - # Output von NormalCrafter: [B,C,H,W] - # 1. Normieren nach [0,1] + # Output from NormalCrafter has the pattern: [B,C,H,W] + # 1. Normalize to a range of [0,1] output_frames_pt = (output_frames_pt.clamp(-1., 1.) * 0.5) + 0.5 - # 2. Resize zurück zur Eingangsauflösung + # 2. Resize back to input-resolution output_frames_pt = F.interpolate( output_frames_pt, size=(orig_h, orig_w), # Eingangsauflösung @@ -469,7 +469,7 @@ class NormalCrafterNode: align_corners=False ) - # 3. Zurück nach [B,H,W,C] für ComfyUI + # 3. Permute Tensor to [B,H,W,C] for ComfyUI-Compatibility output_frames_pt = output_frames_pt.permute(0, 2, 3, 1).contiguous()