Remove in progress images until we're able to make the valuable

This commit is contained in:
Brandon Rising 2024-08-26 12:59:36 -04:00 committed by Brandon
parent cf633e4ef2
commit 3ea6c9666e

View File

@ -116,30 +116,30 @@ class FluxTextToImageInvocation(BaseInvocation, WithMetadata, WithBoard):
if context.util.is_canceled(): if context.util.is_canceled():
raise CanceledException raise CanceledException
# TODO: Make this look like the image # TODO: Make this look like the image before re-enabling
latent_image = unpack(img.float(), self.height, self.width) # latent_image = unpack(img.float(), self.height, self.width)
latent_image = latent_image.squeeze() # Remove unnecessary dimensions # latent_image = latent_image.squeeze() # Remove unnecessary dimensions
flattened_tensor = latent_image.reshape(-1) # Flatten to shape [48*128*128] # flattened_tensor = latent_image.reshape(-1) # Flatten to shape [48*128*128]
# Create a new tensor of the required shape [255, 255, 3] # # Create a new tensor of the required shape [255, 255, 3]
latent_image = flattened_tensor[: 255 * 255 * 3].reshape(255, 255, 3) # Reshape to RGB format # latent_image = flattened_tensor[: 255 * 255 * 3].reshape(255, 255, 3) # Reshape to RGB format
# Convert to a NumPy array and then to a PIL Image # # Convert to a NumPy array and then to a PIL Image
image = Image.fromarray(latent_image.cpu().numpy().astype(np.uint8)) # image = Image.fromarray(latent_image.cpu().numpy().astype(np.uint8))
(width, height) = image.size # (width, height) = image.size
width *= 8 # width *= 8
height *= 8 # height *= 8
dataURL = image_to_dataURL(image, image_format="JPEG") # dataURL = image_to_dataURL(image, image_format="JPEG")
# TODO: move this whole function to invocation context to properly reference these variables # # TODO: move this whole function to invocation context to properly reference these variables
context._services.events.emit_invocation_denoise_progress( # context._services.events.emit_invocation_denoise_progress(
context._data.queue_item, # context._data.queue_item,
context._data.invocation, # context._data.invocation,
state, # state,
ProgressImage(dataURL=dataURL, width=width, height=height), # ProgressImage(dataURL=dataURL, width=width, height=height),
) # )
x = denoise( x = denoise(
model=transformer, model=transformer,