PhotoMaker icon indicating copy to clipboard operation
PhotoMaker copied to clipboard

CUDA error: device-side assert triggered when prompt contains `'img'`

Open yorickvP opened this issue 1 year ago • 1 comments

When the text prompt contains 'img', without a space, this passes the gradio "Cannot find the trigger word" check, but then crashes the delayed conditioning step. After the crash, the CUDA context is corrupted and we have to restart the process.

prompt_text_only = prompt.replace(" "+self.trigger_word, "") doesn't find the trigger word since it doesn't start with a space, and then encode_prompt crashes because the text still contains the trigger token.

Suggested solution: tokenize the entire prompt, remove the trigger word token and re-encode into text.

yorickvP avatar Jan 18 '24 09:01 yorickvP

We're checking this PR. Thank you for your contribution!

Paper99 avatar Jan 19 '24 06:01 Paper99