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.
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.