#Inpainting with Flux Fill - "Init Image Recomposite Mask"

1 messages · Page 1 of 1 (latest)

lilac wing
#

when I use Flux Fill (with full Flux Fill Model, cfg 1, flux guidance 30, 30 steps) Ive noticed the following:

  • without "Init Image Recomposite Mask" the inpaint result is cleaner, but the overall image is changed (not much but noticable in a 1 v 1 comparison)
  • with "Init Image Recomposite Mask" the overall image stays exactly the same, but the area of inpainting is often (most of the time) visible if you have a closer look.

so I'm currently wondering why this is and if I can do something about it.

weak dagger
#

it's easier if you paste your entire metadata

lilac wing
#

init creativity 1, guidance 30, exactly. mask blur default.

weak dagger
#

mask blur default = 0 iirc. setting it higher allows it to blend the results to avoid that visible hard edges where it inpaints

lilac wing
#

default is 4 at least its for me and I havent changed settings. its not the edges its mor like the inpainted area looks different but if i uncheck "init image recomposite mask" the result is as expected.

weak dagger
#

please paste your entire metadata

#

also, please try 8 or 16 in the mask blur and report back. it also deals with the issue you're saying, where inpainted area looks different

#

other reasons can include: you left upscaling turned on, different vae, lora's are too different from original, cfg too high or low. basically anything that creates color/texture differences that are too much to blend.

lilac wing
#

generation data? Model: FLUX/flux1-fill-dev, Seed: 1007946258, Steps: 30, CFG Scale: 1, Aspect Ratio: Custom, Width: 1536, Height: 1024, Flux Guidance Scale: 30, Init Image Creativity: 1, Mask Blur: 4, Automatic VAE: true,
date: 2025-04-14, initimage_filename: assets_task_01jrrfbh44f0k9r37qb960w5jd_img_0.webp, initimage_resolution: 1536x1024, used_image_editor: true, prep_time: 2.25 sec, generation_time: 93.86 sec, Swarm Version: 0.9.5.3,

weak dagger
#

seed should be -1 for inpainting

#

mask blur may be too low. did you use loras in the original img?

lilac wing
#

no the original image is not from flux

weak dagger
#

gotcha. well that will create differences, but mask blur is meant to improve that. the higher you put it, the more extra pixels it uses to 'match' the color, lighting, texture, etc.

lilac wing
#

but why it works better without the recomposite mask feature? and -1 seed is random isnt it? that's what ive set. the generation data then shows the seed that has been used.

regal heron
lilac wing
#

@regal heron i think its really good (flux fill). way better than anything before. (sdxl etc). in your workflow guidance is very low (1.7) . its recommended to be 30 with flux fill afaik.

lilac wing
weak dagger
# lilac wing but why it works better without the recomposite mask feature? and -1 seed is ran...

when using recomposite mask, what it does is to take the result masked area and copy it back over onto the original image. it's cleaner from the standpoint of the rest of the image not being modified at all, but blending can be an issue. with recomposite off, it doesn't do the copy back, so it modifies some of the rest of the image outside the mask, mainly the original image is run through vae process again, so the blending can be better, while the rest of the image is very slightly degraded. on one iteration, this isn't usually an issue, but after inpainting 2, 3, or more times, the artifacts from repeated vae on the entire image start to become very noticeable. so choose whichever way suits your needs better.

#

here's an example with recomposite off over multiple iterations:

regal heron
#

hmmm ... okay but i need at least two start paremters one for replace and one for refine ... its totaly different in foocus in denoise and inpaint-mode ... u have sugesstions?
and 1.7 is that low because 3.o was to high at all for me ^^ (all was much to bright)

lilac wing
#

the suggested values for flux fill are guidance 30, cfg 1. your cfg and guidance (if i see that correctly) are both at 1.7

weak dagger
lilac wing
#

i think my issue is kinda solved or at least now I fully understand the feature. thank you.

weak dagger
# lilac wing i think my issue is kinda solved or at least now I fully understand the feature....

sure thing. hope that description helps. it's not always clear cut. inpainting in swarm is... a little bit more difficult than in some other UI's. i use invokeui sometimes, and people swear by it's inpainting. it's very slick to use, that being said, it lacks all the other power features that swarm has and invokeai has its own issues; i've never not been able to do the same results in swarm, it's just that it's not as intuitive, not as beginner friendly.

lilac wing
#

@regal heron have you tried inpainting directly in the UI with CFG 1, (sampler->) Guidance 30 and flux fill model?

regal heron
weak dagger
# lilac wing the suggested values for flux fill are guidance 30, cfg 1. your cfg and guidance...

@regal heron like mech said:
cfg 1
guidance 30

also:
seed -1
variation seed: disabled
init creativity 1
init image reset to norm: 1 (optional)
steps: 20+ for flux fill
init image recomposite mask: (see above explanation)
upscaling: disabled
mask blur: whatever works, but usually 8 works well for me

also, neat trick: mask shrink grow is a context window. 0 default uses the full input image, setting to 200 (pixels) for example, reduces the context, making the inpainting WAY faster. but too small and flux fill gets confused on what the image is since it can only see the context window

regal heron
#

i only can repeat @weak dagger flux is not that intuitiv inpaint like you said invoke or in my case fooocus

regal heron
lilac wing
#

if its not a close up photo /image you can use mask shrink, its like "masked only" in a1111 ,but you can make the context window bigger with the value, which can be very useful. and most of the time flux fill does not need prompts (to correct things) if you want to change (in my experience) keep it short (like "blonde wavy hair") mask the complete area where you want the hair, try it first without mask shrink , if it s not detailed enough, you can try that. dont forget creativity 1.

#

and steps 30+

weak dagger
lilac wing
#

I always thought -1 means random and i need different seeds to have different results to choose from?

regal heron
weak dagger
#

not sure if they mean the same thing in fooocus

#

is the difference between refine and replace in foocus just a matter of mask transparency or not?

regal heron
#

it depend on this 4 parameter

weak dagger
#

well i'm a little bit guessing here, but i think inpaint and modify content are maybe same thing, and improve detail is like high res fix or segmentation in swarm

regal heron
#

and i dont talk about mask-blure (you can also play) ^^

lilac wing
#

respective field seems to be kinda the same as mask shrink grow , because thats said to be the same as "inpaint only masked" in a1111 😄 so if you use 0 in this respective field its like mask shrink grow activated in SwarmUI (inpaint only masked). 1 would be off. 0,6 would probably be something like 60% of the image around the masked area are visible (i guess), so mask shrink grow active but with a higher value.

regal heron
#

i can send you all 4 parameter for that 3 settings (first above whas for outpaint)

weak dagger
regal heron
#

that is for "improve"

#

that for modify

#

the "inpaint-engine" is principal an inpaint-model

weak dagger
#

ok yea i guessed right. so inpaint denoising strength is mask transparency (or init creativity) in swarm
respective field is 'mask shrink grow' in swarm
and the 3 modes are just presets for denoising and other values, rather than actually 3 real modes

#

you can make your own similar presets in swarm if you want

regal heron
#

oh iam out of brain 🤔 , can you look in one of my workflows or send me these params?

weak dagger
#

Presets->Import Presets
Paste the contents of that file there

#

Change the model to the standard fluxfilldev

lilac wing
#

@regal heron you can also follow along that video at the point of the link on how to use flux fill in swarm https://youtu.be/hewDdVJEqOQ?t=1610&feature=shared

FLUX.1 Tools by BlackForestLabs changed the #AI field forever. They became the number 1 Open Source community provider after this massive release. In this tutorial, I will show you step by step how use FLUX.1 Fill model (inpainting model) to do perfect outpainting (yes this model used for outpainting) and inpainting. Moreover, I will show all fe...

▶ Play video
weak dagger
#

Learn how to master outpainting and inpainting in SwarmUI using Flux Tools Flux-Fill. This quick and straightforward tutorial will show you how to seamlessly expand and modify your generative AI images with ease. Perfect for anyone looking to enhance their AI art skills in just a few minutes!

SwarmUI Discord link:
https://discord.gg/swarmui-124...

▶ Play video
regal heron
#

THX ... and what the main different sets between modify and improve ?

weak dagger
#

pretty pointless tbh

#

better to have full control over denoising

regal heron
#

hmm okay, but fooocus has 3 changes, denoise strength 0.5 vs 1, initial latent denoise and the model

weak dagger
regal heron
#

initial denoise (only on or off) also very heavy ... the model is normal model vs the inpaint_version

weak dagger
#

i was just reading about fooocus' inpainting engine. the model they use is proprietary to them. swarm doesn't have whatever that is, and it does seem to improve inpainting results according to people online

regal heron
weak dagger
#

two different ways to achieve about the same thing as what's called denoising in fooocus

regal heron
#

ok, and that init-one ?

weak dagger
#

init-denoise = init image creativity
denoising = mask transparency

#

(i think)

#

also the refiner feature in fooocus, i'm pretty sure it's just the upscale/refine feature in swarm

#

if i'm wrong on any of this info, i'm sure someone can correct, i did my best to help you on something i'm not familiar with 🙂

weak dagger
#

looks like you can just use fooocus inpaint model stuff in comfy directly, or swarm if it had a reason to be integrated

weak dagger
#

that fooocus inpainting model only works on sdxl not flux from what i read

regal heron
#

so fare i have better results in fooocus maybe some one get better params in flux. here is a bit noise image, where i want the front stuff erase, and "like sitting on couch", but especially the white part on the right side is very bad after inpaint

regal heron
#

btw this part (if i import from gen-tab) go into nothing ^^ and "Init Image Reset To Norm" has no effect...

lilac wing
#

@regal heron Besides playing with a higher mask blur value (which can help in some cases), I've now found another value that can fix/reduce this. under advanced sampling ("display advanced options" need to be activated). "Color Correction Behaviour: Linear"

thanks to this video ( https://youtu.be/09UsITSDJmA?feature=shared ) that brought it to my attention.

lavish tundra
#

thanks guys, I have read your whole conversation, was very informative. I stopped using Flux Fill because of the traces it often leaves, now I have new hope ❤️

regal heron
#

thy ... yes i have found this json workflow ... 2 parts flux.fill + flux.dev
its works a bit better ...
but no matter how much i play around with the parameters , i get in FOOOCUS with the inpaint at option optimize eg skin or eyes ... and option change eg delete person in background so fast so much better results of course with SDXL model