davefojtik / RunPod-Fooocus-API

RunPod serverless worker for Fooocus-API. Standalone or with network volume
GNU General Public License v3.0
35 stars 16 forks source link

inpaint_additional_prompt should not be necessary for inpaint_preset #21

Closed CyrusVorwald closed 6 months ago

CyrusVorwald commented 6 months ago

inpaint_additional_prompt just extends the default prompt. https://github.com/lllyasviel/Fooocus/blob/e2f9bcb11d06216d6800676c48d8d74d6fd77a4b/modules/async_worker.py#L367

if I pass in an empty string, it works all the same.

davefojtik commented 6 months ago

inpaint_preset is actually not even in Fooocus-API. It's our own implementation of what a user missed from the original Fooocus. You can do the same by using inpainting without it and specifying a couple of params - see here (#13)

But I guess you're right that the user can use both normal prompt or/and inpaint_additional_prompt to describe the inpainting. So perhaps we should either check if at least one of them is present or just avoid the check and let fooocus handle possible errors. I just saw the inpaint_additional_prompt as a more logical place to always type the inpaint prompt into, and wanted to make sure the users don't forget about specifying it. But the check can be rather restrictive in such scenario.

CyrusVorwald commented 6 months ago

I may misunderstand it, but I thought inpaint_additional_prompt only appends the prompt, so what gets inpainted ends up being based on prompt + inpaint_additional_prompt as opposed to just inpaint_additional_prompt. The issue is that users would intend only for inpaint_additional_prompt to be used, as opposed to both.

davefojtik commented 6 months ago

Well based on the code you mentioned:

if inpaint_additional_prompt != '':
    if prompt == '':
        prompt = inpaint_additional_prompt
    else:
        prompt = inpaint_additional_prompt + '\n' + prompt

It prepends the prompt so it's inpaint_additional_prompt + prompt when the normal prompt is not empty, and just inpaint_additional_prompt when the normal prompt is empty. But in both cases, the additional one has to be specified otherwise only the normal prompt is used. But as I just tested in local Fooocus there are no checks at all. It even lets you inpaint nothing with both empty 😀So I guess I'll just remove the check completely too. Perhaps it was just my webdev instinct to give user input limits and guidance. But who am I to tell people they can't inpaint nothing. I'll fix it in the repo code soon