@@ -116,30 +116,30 @@ def step_callback(img: torch.Tensor, state: PipelineIntermediateState) -> None:
116
116
if context .util .is_canceled ():
117
117
raise CanceledException
118
118
119
- # TODO: Make this look like the image
120
- latent_image = unpack (img .float (), self .height , self .width )
121
- latent_image = latent_image .squeeze () # Remove unnecessary dimensions
122
- flattened_tensor = latent_image .reshape (- 1 ) # Flatten to shape [48*128*128]
123
-
124
- # Create a new tensor of the required shape [255, 255, 3]
125
- latent_image = flattened_tensor [: 255 * 255 * 3 ].reshape (255 , 255 , 3 ) # Reshape to RGB format
126
-
127
- # Convert to a NumPy array and then to a PIL Image
128
- image = Image .fromarray (latent_image .cpu ().numpy ().astype (np .uint8 ))
129
-
130
- (width , height ) = image .size
131
- width *= 8
132
- height *= 8
133
-
134
- dataURL = image_to_dataURL (image , image_format = "JPEG" )
135
-
136
- # TODO: move this whole function to invocation context to properly reference these variables
137
- context ._services .events .emit_invocation_denoise_progress (
138
- context ._data .queue_item ,
139
- context ._data .invocation ,
140
- state ,
141
- ProgressImage (dataURL = dataURL , width = width , height = height ),
142
- )
119
+ # TODO: Make this look like the image before re-enabling
120
+ # latent_image = unpack(img.float(), self.height, self.width)
121
+ # latent_image = latent_image.squeeze() # Remove unnecessary dimensions
122
+ # flattened_tensor = latent_image.reshape(-1) # Flatten to shape [48*128*128]
123
+
124
+ # # Create a new tensor of the required shape [255, 255, 3]
125
+ # latent_image = flattened_tensor[: 255 * 255 * 3].reshape(255, 255, 3) # Reshape to RGB format
126
+
127
+ # # Convert to a NumPy array and then to a PIL Image
128
+ # image = Image.fromarray(latent_image.cpu().numpy().astype(np.uint8))
129
+
130
+ # (width, height) = image.size
131
+ # width *= 8
132
+ # height *= 8
133
+
134
+ # dataURL = image_to_dataURL(image, image_format="JPEG")
135
+
136
+ # # TODO: move this whole function to invocation context to properly reference these variables
137
+ # context._services.events.emit_invocation_denoise_progress(
138
+ # context._data.queue_item,
139
+ # context._data.invocation,
140
+ # state,
141
+ # ProgressImage(dataURL=dataURL, width=width, height=height),
142
+ # )
143
143
144
144
x = denoise (
145
145
model = transformer ,
0 commit comments