Skip to content

Commit

Permalink
fix crash at end of render
Browse files Browse the repository at this point in the history
  • Loading branch information
TNTwise committed Sep 15, 2024
1 parent 418a3f8 commit 77dc12a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 1 addition & 2 deletions REAL-Video-Enhancer.py
Original file line number Diff line number Diff line change
Expand Up @@ -380,10 +380,9 @@ def onRenderCompletion(self):
pass # pass just incase internet error caused a skip
# reset image preview
self.previewLabel.clear()
self.startRenderButton.setVisible(True)
self.pauseRenderButton.setVisible(False)
self.startRenderButton.clicked.disconnect()
self.startRenderButton.clicked.connect(self.startRender)

self.enableProcessPage()

def disableProcessPage(self):
Expand Down
2 changes: 1 addition & 1 deletion backend/src/UpscaleTorch.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ def renderImage(self, image: torch.Tensor) -> torch.Tensor:
@torch.inference_mode()
def renderToNPArray(self, image: torch.Tensor) -> torch.Tensor:
while self.model is None:
sleep(0)
sleep(1)
if self.tilesize == 0:
output = self.renderImage(image)
else:
Expand Down
4 changes: 4 additions & 0 deletions src/ui/ProcessTab.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,10 @@ def renderToPipeThread(self, method: str, backend: str, interpolateTimes: int):
log(str(textOutput))
self.renderProcess.wait()
# done with render
# Have to swap the visibility of these here otherwise crash for some reason
self.parent.pauseRenderButton.setVisible(False)
self.parent.startRenderButton.setVisible(True)
self.parent.startRenderButton.setEnabled(True)
self.parent.onRenderCompletion()

def getRoundedPixmap(self, pixmap, corner_radius):
Expand Down

0 comments on commit 77dc12a

Please sign in to comment.