Auto preserve image size for in-place edits?

#241
by jbiniek - opened

Hi, I'm taking my first steps in ComfyUI and wanted to use your model for editing existing images and photos (e.g. removing a car from background). I want the originals to be unaffected, aside from the particular area being edited.
I found this to work best when output is the same size as input (I use v19). However I have to keep readjusting Final Image Size Latent as I have various sources and crops. Is it possible in this workflow to automatically use input image size as output size?

There are nodes that analyze the source image width and length and converts it to latent. Use one of those.

Thank you. I figured it out so I'm leaving this here in case somebody else finds it useful:

  1. Double click on the work area to look for nodes. Find Get Image Size and add it.
  2. Drag the IMAGE from Optional Input Image to the input of Get Image Size.
  3. Drag the output dot e.g. width and drop it on the corresponding text box of Final Image SIze (Empty Latent Image); repeat for height.
    Done! Generated image will now automatically assume the same size as input now. Together with the magical spell "Keep everything else unchanged" at the end of the prompt this works very well for making edits.

Sign up or log in to comment