primerz commited on
Commit
d5e4dfd
·
verified ·
1 Parent(s): 8188bc4

Update generator.py

Browse files
Files changed (1) hide show
  1. generator.py +3 -2
generator.py CHANGED
@@ -153,8 +153,9 @@ class RetroArtConverter:
153
  if image.mode != 'RGB':
154
  image = image.convert('RGB')
155
 
156
- # ZoeDetector handles everything internally - just pass the image
157
- depth_image = self.zoe_depth(image)
 
158
 
159
  # Use .width and .height properties (always Python ints, not numpy types)
160
  print(f"[DEPTH] Zoe depth map generated: {image.width}x{image.height}")
 
153
  if image.mode != 'RGB':
154
  image = image.convert('RGB')
155
 
156
+ # CRITICAL: ZoeDetector must be called with torch.no_grad()
157
+ with torch.no_grad():
158
+ depth_image = self.zoe_depth(image)
159
 
160
  # Use .width and .height properties (always Python ints, not numpy types)
161
  print(f"[DEPTH] Zoe depth map generated: {image.width}x{image.height}")