Skip to content

Commit

Permalink
fixed image gen
Browse files Browse the repository at this point in the history
  • Loading branch information
thijsi123 committed Feb 1, 2024
1 parent 1c1dfe1 commit dc5a41c
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions app/oobabooga - webui.py
Original file line number Diff line number Diff line change
Expand Up @@ -735,7 +735,6 @@ def generate_character_avatar(
)
print(sd_prompt)
sd_filter(nsfw_filter)
process_uploaded_image
return image_generate(character_name,
sd_prompt,
input_none(negative_prompt),
Expand Down Expand Up @@ -766,9 +765,18 @@ def image_generate(character_name, prompt, negative_prompt):
character_name = character_name.replace(" ", "_")
os.makedirs(f"characters/{character_name}", exist_ok=True)

card_path = f"characters/{character_name}/{character_name}.png"
image_path = f"characters/{character_name}/{character_name}.png"

# Save the generated image
generated_image.save(image_path)

# Load the image back into a NumPy array
reloaded_image = Image.open(image_path)
reloaded_image_np = np.array(reloaded_image)

# Call process_uploaded_image
process_uploaded_image(reloaded_image_np)

generated_image.save(card_path)
print("Generated character avatar")
return generated_image

Expand Down
Binary file added characters/Kaori/Kaori.card.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added characters/Kaori/Kaori.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit dc5a41c

Please sign in to comment.