Fooocus-API icon indicating copy to clipboard operation
Fooocus-API copied to clipboard

Inpaint is slow because of preparation time and model switching

Open CyrusVorwald opened this issue 1 year ago • 5 comments

Inpaint switches and loads models at initialization and again halfway through the steps. It takes about 4x as long as regular image generation between that and the preparation time. I tried setting inpaint_disable_initial_latent to true but it didn't impact timing very much.

CyrusVorwald avatar Feb 11 '24 16:02 CyrusVorwald

To reduce cold start time, it only download base model files of the preset when startup. And when using adavance functions such as upscale, inpaint or outpaint, downloading on demand will happend. The interface provided by replicate cannot achieve very flexible use purposes.

konieshadow avatar Feb 14 '24 12:02 konieshadow

This occurs every time inpaint is run, even if done repeatedly within a short time period.

CyrusVorwald avatar Feb 14 '24 12:02 CyrusVorwald

This occurs every time inpaint is run, even if done repeatedly within a short time period.

I don't have much time to run much tests now. Can you compare it to local deployment (python main.py) and origin Fooocus?

konieshadow avatar Feb 14 '24 13:02 konieshadow

Sorry to ask a semi-unrelated question in this thread but how does one get inpainting to work?

What format should the image mask be? I've tried both transparent + white pixels for my mask and transparent+black pixels for my mask. Every time I try I just get a new image generation back taking up the whole canvas.

Here is how I have it set up on replicate inpaint image image

inpaint mask (I've tried both black and white masks) image

additional in paint prompt image

Then this is the output I get

image

jareddr avatar Feb 14 '24 21:02 jareddr

Sorry I answered my own question by looking at the code. Mask is working great with black = no change and white = in paint.

homer-simpson-bush-gif

jareddr avatar Feb 14 '24 22:02 jareddr