michaelistrofficus / diffuse_my_lyrics Goto Github PK
View Code? Open in Web Editor NEWA dummy project to generate images from song lyrics using Stable Diffusion
A dummy project to generate images from song lyrics using Stable Diffusion
Hello @MichaelisTrofficus
The library is awesome!
After using the library, I have a few feature requests:
maybe at the bottom of the image,
or the file name keeping the prefix in the numeric order, as it is now (eg: 1_substr_line_one_of_lyrics.png).
this would help the user understand the image and which prompt it was generated from
besides the existing input via txt file and output as pgn file,
allowing support for string input and image buffer output
this would help the library to be used in dynamic events to feed the function with an input string and get an image output.
the current implementation only allows the library to be used as a background running script.
this point you have already considered in your "next steps". Looking forward to that!
I was trying out the code from the sample code snippets from the readme in google colab environment.
here is my sample code:
# Install the latest version of the package
%pip install -U diffuse-my-lyrics
# Import the Lyrics2Images class
from diffuse_my_lyrics import Lyrics2Images
l2i = Lyrics2Images(num_inference_steps=100) # In this case, we are indicating the model to run for 100 steps
l2i.run(input_path="./lyrics.txt", output_path="./out")
full error stack:
TypeError Traceback (most recent call last)
[<ipython-input-9-06e26054323b>](https://localhost:8080/#) in <module>
3
4 l2i = Lyrics2Images(num_inference_steps=100) # In this case, we are indicating the model to run for 100 steps
----> 5 l2i.run(input_path="./lyrics.txt", output_path="./out")
2 frames
[/usr/local/lib/python3.9/dist-packages/diffuse_my_lyrics/lyrics_to_images.py](https://localhost:8080/#) in run(self, input_path, output_path)
38 def run(self, input_path: str, output_path: str):
39 verses = parse_lyrics(input_path, self.prompt)
---> 40 pipe = self.load_model_pipeline()
41
42 try:
[/usr/local/lib/python3.9/dist-packages/diffuse_my_lyrics/lyrics_to_images.py](https://localhost:8080/#) in load_model_pipeline(self)
31
32 def load_model_pipeline(self) -> StableDiffusionPipeline:
---> 33 return StableDiffusionPipeline.from_pretrained(self.model_id,
34 revision=self.revision,
35 torch_dtype=self.torch_dtype,
[/usr/local/lib/python3.9/dist-packages/diffusers/pipeline_utils.py](https://localhost:8080/#) in from_pretrained(cls, pretrained_model_name_or_path, **kwargs)
237 load_method_name = importable_classes[class_name][1]
238
--> 239 load_method = getattr(class_obj, load_method_name)
240
241 loading_kwargs = {}
TypeError: getattr(): attribute name must be string
I think something is wrong inside pipeline_utils.py
-> getattr()
function
or the model/dependencies got updated which is causing the issue.
@MichaelisTrofficus could you please look into the issue or suggest to me if I am going wrong somewhere?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.