Whitespace/Newlines between tags in Negative Prompt alter output and persist in cache
- Dominant language
- Python
- Stars
- 133k
- Forks
- 15.7k
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 158
Description
### Custom Node Testing
- [x] I have tried disabling custom nodes and the issue persists (see [how to disable custom nodes](https://docs.comfy.org/troubleshooting/custom-node-issues#step-1%3A-test-with-all-custom-nodes-disabled) if you need help)
### Expected Behavior
When using a fixed seed, the generated image should remain identical regardless of the formatting between tags in the negative prompt. Specifically, adding or removing a space or a line break after a comma separator (e.g., changing tag1,tag2 to tag1, tag2) should not change the CLIP encoding or the resulting image.
### Actual Behavior
Changing only the formatting of the negative prompt (such as adding spaces or line breaks) causes the generated image to change.
Reverting the negative prompt back to its original form does not restore the original image. The result only becomes consistent again after clearing node cache or restarting ComfyUI.
### Steps to Reproduce
1. Open ComfyUI with the default workflow
2. Use an SDXL model
3. Set a fixed seed
4. Enter a negative prompt with multiple tokens
`q,w,e,r,t,y,u,i,o,a,s,d,f`
5. Generate the image
6. Modify only formatting of the negative prompt, for example:
- Add a space:
`q,w,e,r,t,y, u,i,o,a,s,d,f`
- Add a line break:
_q,w,e,r,t,y,
u,i,o,a,s,d,f_
7. Generate again and compare results
### Debug Logs
```There is no error message```
### Other
Once the negative prompt has been reformatted, it affects not only the current generation but also all subsequent generations in the workflow. The deviation persists across future images until the cache is cleared or ComfyUI is restarted.
This issue does not occur in version 0.9.2
In 0.9.2, I can freely reformat the negative prompt without affecting the generated image
Environment:
ComfyUI versions tested: 0.18.2 → 0.20.0
Workflow: Default workflow
Model: SDXL-based models
Contributor guide
Assessment
This issue has not been assessed yet.