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

How to use improve detail in image inpaint

Open anilsathyan7 opened this issue 1 year ago • 2 comments

How to choose the inpaint method(improve detail) in api v2/generation/image-inpaint-outpaint. Its' not mentioned in docs.

Is it sufficient to pass only these settings in advanced params(other params will take default?)

"advanced_params": {
                "inpaint_disable_initial_latent" = false
                "inpaint_strength" = 0.5
                "inpaint_respective_field" = 0.0
                "inpaint_engine" = 'None'}

anilsathyan7 avatar Apr 22 '24 11:04 anilsathyan7

I have do some test, yes, is enough.

just like this

if inpaint_method == 'Improve Detail (face, hand, eyes, etc.)':
    inpaint_disable_initial_latent = False
    inpaint_strength = 0.5
    inpaint_respective_field = 0.0
    inpaint_engine = 'None'
elif inpaint_method == 'Modify Object (add objects, change background, etc.)':
    inpaint_disable_initial_latent = True
    inpaint_strength = 1.0
    inpaint_respective_field = 0.0

thx for your params

mrhan1993 avatar Apr 24 '24 02:04 mrhan1993

Thank you guys ! I spent 12 hours doing testing: I was unsuccessful in nailing that . Actually I had a long post prepared with JSON and comparison logs between Fooocus and Fooocus API. You will not have to read it :) I confirm it works: the "inpaint_disable_initial_latent" makes all the difference, especially for face improvement (without it, it is terrible !). Always open the python code first, this should be the rule ! Thanks for all your work guys !

chenav avatar Apr 24 '24 07:04 chenav