ironjr / StreamMultiDiffusion

Official code for the paper "StreamMultiDiffusion: Real-Time Interactive Generation with Region-Based Semantic Control."
https://jaerinlee.com/research/streammultidiffusion
MIT License
518 stars 43 forks source link

app.py cannot run #14

Closed yhqqxq closed 2 months ago

yhqqxq commented 2 months ago

Traceback (most recent call last): File "G:\AI\ZHB\StreamMultiDiffusion\demo\stream_v2\app.py", line 155, in prompts_props = [l.strip() for l in f.readlines() if l.strip() != ''] UnicodeDecodeError: 'gbk' codec can't decode byte 0x8f in position 68: illegal multibyte sequence

How should this problem be solved?

ironjr commented 2 months ago

Thanks for trying the demo.

with open(os.path.join(example_root, 'prompt_background.txt'), 'r', encoding='utf-8') as f:
    prompts_background = [l.strip() for l in f.readlines() if l.strip() != '']

with open(os.path.join(example_root, 'prompt_girl.txt'), 'r', encoding='utf-8') as f:
    prompts_girl = [l.strip() for l in f.readlines() if l.strip() != '']

with open(os.path.join(example_root, 'prompt_boy.txt'), 'r', encoding='utf-8') as f:
    prompts_boy = [l.strip() for l in f.readlines() if l.strip() != '']

with open(os.path.join(example_root, 'prompt_props.txt'), 'r', encoding='utf-8') as f:
    prompts_props = [l.strip() for l in f.readlines() if l.strip() != '']
    prompts_props = {l.split(',')[0].strip(): ','.join(l.split(',')[1:]).strip() for l in prompts_props}

I just changed the file reading options as above for the compatibility. Please rerun git pull origin main. If you find any other problem, feel free to reopen this issue.