Skip to content

Commit

Permalink
Changes in stable diffusion (#960)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tarraann authored Aug 3, 2023
1 parent 9c93b00 commit edc1c50
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions superagi/tools/image_generation/stable_diffusion_image_gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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")
Expand Down

0 comments on commit edc1c50

Please sign in to comment.