stable-diffusion icon indicating copy to clipboard operation
stable-diffusion copied to clipboard

reading prompts from none

Open indrakhatiwada opened this issue 2 years ago • 3 comments

D:\Man and the machine\stable-diffusion>python optimizedSD/optimized_txt2img.py --prompt "Cyberpunk style image of a Telsa car reflection in rain" --H 512 --W 512 --seed 27 --n_iter 2 --n_samples 10 --ddim_steps 50 Global seed set to 27 Loading model from models/ldm/stable-diffusion-v1/model.ckpt Global Step: 470000 UNet: Running in eps-prediction mode CondStage: Running in eps-prediction mode FirstStage: Running in eps-prediction mode making attention of type 'vanilla' with 512 in_channels Working with z of shape (1, 4, 32, 32) = 4096 dimensions. making attention of type 'vanilla' with 512 in_channels reading prompts from None Traceback (most recent call last): File "optimizedSD/optimized_txt2img.py", line 349, in get_image( File "optimizedSD/optimized_txt2img.py", line 54, in get_image with open(opt.from_file, "r") as f: TypeError: expected str, bytes or os.PathLike object, not NoneType

indrakhatiwada avatar Sep 05 '22 15:09 indrakhatiwada

i have been following a medium article to install this. i just want to try this once but this error occurs

indrakhatiwada avatar Sep 05 '22 16:09 indrakhatiwada

@basujindal @indrakhatiwada the optimized_txt2img.py needs to be updated line 47 checks for prompt which is not initialized until you're inside the context on line 48. either "prompt = opt.prompt" should be moved above line 47. or 47 should be "...and opt.prompt is not None:"

ttarabbia avatar Sep 05 '22 16:09 ttarabbia

@basujindal @indrakhatiwada the optimized_txt2img.py needs to be updated line 47 checks for prompt which is not initialized until you're inside the context on line 48. either "prompt = opt.prompt" should be moved above line 47. or 47 should be "...and opt.prompt is not None:"

Hi, thank you for reporting the error and the solution, I have fixed it and will push the changes. Thanks!

basujindal avatar Sep 06 '22 07:09 basujindal