mrhan1993 / Fooocus-API

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

sending inpaint mask to 'mixing-image-prompt-with-inpaint' #387

Open AliReDehghan opened 1 month ago

AliReDehghan commented 1 month ago

Hi, Thank you very much for developing the API, it is much appriciated.

I'm trying to mix inpaint with image prompt, I'm using a form on the front end to capture the inpaint image and image prompt. the parameter mixing image prompt with inpaint is set to true in the api request. but I get the result back without the processing. I can only imagine that I'm doing something wrong or I should somehow capture inpaint area (like the webui) on the image and send it with the api request? any idea on how to do this?

would appreciate your help in how to solve this.

thanks in advance

mrhan1993 commented 1 month ago

can i have a look your requests

AliReDehghan commented 3 weeks ago

sorry for my late reply, where i am now i don't have access to stable internet connection. apologies.

here is my request, just fyi I'm using it with replicate:

output = replicate.run( "mrhan1993/fooocus-api:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", input={ "prompt": "prompt to inpaint", "input_image": "link to image for inpaint", #no problem with link as it works for image prompt "input_mask": "link to the mask photo", "sharpness": 2, "image_seed": -1, "uov_method": "Disabled", "image_number": 1, "guidance_scale": 7, "refiner_switch": 0.5, "negative_prompt": "", "style_selections": "Fooocus V2,Fooocus Enhance,Fooocus Sharp", "loras_custom_urls": "", "uov_upscale_value": 0, "use_default_loras": True, "outpaint_selections": "", "outpaint_distance_top": 0, "performance_selection": "Quality", "outpaint_distance_left": 0, "aspect_ratios_selection": "1152*896", "outpaint_distance_right": 0, "outpaint_distance_bottom": 0, "inpaint_additional_prompt": "ptompt to inpaint", } ) print(output)

everything works except "inpaint" and "mixing inpaint with image prompt" these two don't work at all.

your help will be much appreciated.