From edc1c508c7494c2ff9dfd1c20d6303a85b314a82 Mon Sep 17 00:00:00 2001 From: Taran <97586318+Tarraann@users.noreply.github.com> Date: Thu, 3 Aug 2023 18:12:23 +0530 Subject: [PATCH] Changes in stable diffusion (#960) --- .../image_generation/stable_diffusion_image_gen.py | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/superagi/tools/image_generation/stable_diffusion_image_gen.py b/superagi/tools/image_generation/stable_diffusion_image_gen.py index 6831f5d98..b3c5d2c96 100644 --- a/superagi/tools/image_generation/stable_diffusion_image_gen.py +++ b/superagi/tools/image_generation/stable_diffusion_image_gen.py @@ -61,7 +61,6 @@ def _execute(self, prompt: str, image_names: list, width: int = 512, height: int for artifact in artifacts: base64_strings.append(artifact['base64']) - image_paths=[] for i in range(num): image_base64 = base64_strings[i] img_data = base64.b64decode(image_base64) @@ -72,16 +71,7 @@ def _execute(self, prompt: str, image_names: list, width: int = 512, height: int self.resource_manager.write_binary_file(image_names[i], img_byte_arr.getvalue()) - for image in image_names: - final_path = ResourceHelper.get_agent_read_resource_path(image, agent=Agent.get_agent_from_id( - session=self.toolkit_config.session, agent_id=self.agent_id), agent_execution=AgentExecution - .get_agent_execution_from_id(session=self - .toolkit_config.session, - agent_execution_id=self - .agent_execution_id)) - image_paths.append(final_path) - - return f"Images downloaded and saved successfully at the following locations: {image_paths}" + return f"Images downloaded and saved successfully!!" def call_stable_diffusion(self, api_key, width, height, num, prompt, steps): engine_id = self.get_tool_config("ENGINE_ID")