From 1b2b013c0f6e644363bfb83b0c9bee1f35ca409a Mon Sep 17 00:00:00 2001 From: Robin Tuszik <47579899+rtuszik@users.noreply.github.com> Date: Tue, 3 Sep 2024 02:27:13 +0200 Subject: [PATCH] refactor(gui): optimize ImageGeneratorGUI class Remove unnecessary comments and adjust notification settings --- src/gui.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/gui.py b/src/gui.py index bd5a82b..b5e41c9 100644 --- a/src/gui.py +++ b/src/gui.py @@ -78,7 +78,6 @@ def __init__(self, image_generator): "replicate_model", ] - # Initialize attributes for attr in self._attributes: setattr(self, attr, None) @@ -457,6 +456,7 @@ def check_api_key(self): type="warning", close_button="OK", timeout=10000, # 10 seconds + position="top", ) async def reset_to_default(self): @@ -494,7 +494,6 @@ async def start_generation(self): ) return - # Run set_model in a separate thread if it's a blocking operation await asyncio.to_thread( self.image_generator.set_model, self.replicate_model_select.value ) @@ -526,7 +525,6 @@ async def start_generation(self): logger.info(f"Generating images with params: {json.dumps(params, indent=2)}") try: - # Assuming generate_images is also a blocking operation, we'll run it in a thread too output = await asyncio.to_thread( self.image_generator.generate_images, params )