Closed Tymski closed 2 years ago
Looking at the code, the file would likely just contain several text prompts for testing purposes? Maybe? How it would be generated I'm not sure. I have a horrible, hacky workaround to offer! 😁
You could try doing something like this:
Comment out the lines for prompt_file
and prompts
as well as the existing try:
block and replace them with:
prompt=args.text
try:
print(f"Starting run for\t{prompt}")
clean_prompt = prompt.replace(" ", "_").replace(".", "")[:80]
do_run(prompt, prefix=clean_prompt)
gc.collect()
except KeyboardInterrupt:
print(f"Canceled, uploading partial results.")
That seems to work for me!
Though I had to
git clone https://github.com/LAION-AI/aesthetic-predictor
into the ldm-finetune
folder first because it was looking for that dependency.
I tried editing the file as you indicated above but now I receive a different error:
Traceback (most recent call last): File "/home/kyle/ldm-finetune/sample.py", line 752, in <module> do_run(prompt, prefix=clean_prompt) File "/home/kyle/ldm-finetune/sample.py", line 716, in do_run init = Image.open(args.init_image).convert("RGB") File "/home/kyle/.venv/lib/python3.10/site-packages/PIL/Image.py", line 3068, in open fp = builtins.open(filename, "rb") FileNotFoundError: [Errno 2] No such file or directory: 'picture.jpg'
I did try creating an "args.text" file if that alleviated the issue but I got no change.
Thanks, @Kreevoz that works for me.
I tried editing the file as you indicated above but now I receive a different error:
Traceback (most recent call last): File "/home/kyle/ldm-finetune/sample.py", line 752, in <module> do_run(prompt, prefix=clean_prompt) File "/home/kyle/ldm-finetune/sample.py", line 716, in do_run init = Image.open(args.init_image).convert("RGB") File "/home/kyle/.venv/lib/python3.10/site-packages/PIL/Image.py", line 3068, in open fp = builtins.open(filename, "rb") FileNotFoundError: [Errno 2] No such file or directory: 'picture.jpg'
I did try creating an "args.text" file if that alleviated the issue but I got no change.
You're using the "# sample with an init image" prompt from the readme, right? So it expects you to provide it with an init_image.
If it can't find picture.jpg then maybe you should make and copy one into the folder (of course it can be named anything you like)! Square, 256x256px or whatever size you want to run inference at.
Thanks I did get it working, however it seems my 2070 Super with 8GB of memory is just barely enough to get a simple result. Well I guess I'll be doing this in the cloud then.
Hello, what should be the contents of artistic_prompts.json? It is used in sample.py, but it is missing. Running the sample returns an error.