mrhan1993 / Fooocus-API

FastAPI powered API for Fooocus
GNU General Public License v3.0
508 stars 135 forks source link

Foocus-api gets into an unrecoverable state after receving a prompt longer than 1024 tokens #223

Closed bnogas closed 4 months ago

bnogas commented 4 months ago

Issue: Whenever too long prompt is sent to fooocus-api it goes into an unrecoverable state. It fails all the subsequent requests after receving a single one with > 1024 tokens. Additionally /ping endpoint still returns 200.

I'm attaching the server log: error.log

And an input that causes the issue input2.json

curl -X POST -H "Content-Type: application/json" -d @input2.json http://foocus-api-address/v2/generation/image-prompt
mrhan1993 commented 4 months ago

After my testing, it was confirmed that the problem exists. After using Focus for testing, I believe that this should be a support issue with Focus. As it cannot be resolved at the moment, it is recommended not to use it in this way.

Demuzx commented 4 months ago

I tested this on method v1/generation/text-to-image and this error also appears. We generate a lot of images per day and this error is very critical for us. For a long time we couldn’t understand what the problem was until we found this topic. We will have to cut the number of tokens. (((