Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

img2img works #16

Closed
barepixels opened this issue Aug 23, 2023 · 18 comments
Closed

img2img works #16

barepixels opened this issue Aug 23, 2023 · 18 comments

Comments

@barepixels
Copy link

Just starting to play with img2img and am so happy. Thank you

So far I only played with 2 sliders from the Advanced tab "Img2img Start Step" and "Img2img Denoise"

Also I want to as if you should make a "discussions" area on GitHub similar to what lllyasviel did here https://github.com/lllyasviel/Fooocus/discussions

I feel the "Issues" area should reserve for bug report.

@barepixels
Copy link
Author

Let's call the image I upload "base image"
If I set random seed and batch 5 images
Does each of the batch images generate from the original "base image" or does
batch image #2 get generated from batch image #1 THEN
batch image #3 get generated from batch image #2
and so on

@MoonRide303
Copy link
Owner

@barepixels Good points, discussions enabled.

As for your question - both modes you described make sense (single image, and cycling over different images when more of them is available), but currently all images generated with img2img are using first image from the gallery as an input (so you can see different variants of it, generated using different seeds).

@MoonRide303
Copy link
Owner

MoonRide303 commented Aug 23, 2023

@barepixels I've just implemented cyclic over input images as the default behaviour for img2img (available on moonride-main). So for example if you have image A, and image B as inputs, and batch size 4, then you will get 2 variants of image A, and 2 variants of image B.

And if you would like to have 4 variants of image A, then you simply load only image A as the source image.

Let me know if it works for you.

@barepixels
Copy link
Author

Loading more than one images (A & B) works

Not sure if I will ever load more than 1 because I want to focus on 1 task at a time.

What I would like to see is to have the original uploaded image "A" in the gallery. This will serve 2 purpose

a) easy to compare before and after
b) Ensure all images generated with img2img are using the first image from the gallery (the uploaded image "A") as input

@MoonRide303
Copy link
Owner

@barepixels That could complicate UI, and I'd like to keep initial view as simple as possible - I will need to think a bit about how those function could be added to the UI, without making it cluttered.

@barepixels
Copy link
Author

Maybe I have not said it clearly. Let me try to illustrate it with Photoshop. Hang on

@barepixels
Copy link
Author

barepixels commented Aug 23, 2023

This is what I am asking for
After generating 1 using img2img, to include the original (left image) with the generated version (right). If more than 1 generated, the original (left image) is always at the top of the list

This will serve 2 purpose

a) easy to compare before and after
b) Ensure all images generated by img2img are using the first image from the gallery (the uploaded image on the left) as input

Fooocus 1 0 40 MRE

This does not affect the existing elegant interface. No extra button or tab

@MoonRide303
Copy link
Owner

@barepixels Okay, that makes sense - I will try to figure out something like this.

@barepixels
Copy link
Author

barepixels commented Aug 23, 2023

Thank you.

@MoonRide303
Copy link
Owner

@barepixels I have initial idea for for the layout (and initial buggy implementation - it's currently messed up when preview is displayed, etc.) - I'd like to use two tabs for separate inputs and outputs galleries, it would look like that:
image
image

@barepixels
Copy link
Author

that would work. plus the preview will be bigger :-)

@MoonRide303
Copy link
Owner

@barepixels Implemented, available on moonride-main :).

@barepixels
Copy link
Author

barepixels commented Aug 23, 2023

Excellent my friend. I can compare let's say #3 vs the original just by clicking on the two tabs back and forth. :-)

Not exactly sure how the Output to Input feature works. I assume:

  1. Click the Output to Input button
  2. Highlight (orange border) which I want to use for the "Output to Input" feature
  3. Choose how many
  4. Press "Generate"

Can you confirm this is correct?

Fooocus 1 0 40 MRE

@MoonRide303
Copy link
Owner

MoonRide303 commented Aug 23, 2023

@barepixels Selection doesn't matter. If you have 1 image loaded as input, then it will use it for every generated output. If you will load 2, then it will cycle over these 2. So with imported images A and B, and batch size 8 you would get 4 variants of A, and 4 variants of B. If you loaded just A - you would get 8 variants of A.

You can also put inputs of completely different resolutions and aspect ratios - it will automatically upscale (or downscale) input image to roughly 1 megapixel each. And if you didn't set any input, but generated already something to Output - it will automatically import that for further processing :).

Default img2img settings allow it to change input image quite a lot, and use it mostly as a rough guidence - if you want to verify how it works and see similarity between images more clearly, then you can lower Denoise (in Advanced tab) to let's say 0.7 or 0.8 - it will preserve much more from the input images, then.

@barepixels
Copy link
Author

barepixels commented Aug 23, 2023

Here is a potential problem I might have (I think)

  1. I upload an image for img2img
  2. I set a style I want
  3. I set 32 to generate
  4. It will give me 32 versions to compare :-)
  5. NOW if I press output to input
  6. It will send ALL 32 to "input tab" (that is a lot, maybe too much, especially if 30 of them I do not like) I will have to wait for a long time OR quit CMD and relaunch since there is no abort button

As for Denoise (in Advanced tab), default minimum is at 0.5? What if I want 0.2

@MoonRide303
Copy link
Owner

@barepixels For now in situations like that simplest solution would be simply using "Load Image(s)", and picking those you want from the output folder.

I guess it would be nice to be able to send selected to the input gallery, but I am not sure how to proceed about that - I will need to take a deeper look into Gradio and Gallery in there, to see if and how it could be done.

Theoretically you could use very low denoise like that, but it wouldn't change input much - but if you find it useful / needed, then sure - I'll change it.

@barepixels
Copy link
Author

barepixels commented Aug 23, 2023

Thank you for changing default Denoise.

The "simplest solution would be simply using "Load Image(s)", and picking those you want from the output folder." Agree, this is good enough. Sometimes too much is bad

I think you should stop/drop working on the "Output to Input" and focus on other modifications... such as Abort button. haha

I tried to just reload the browser hoping to abort the queue but it didn't work ... because there was no signal to tell Fooocus to stop. I felt stupid. haha

@MoonRide303
Copy link
Owner

Next thing worth doing would be probably preparing easy to use (like download + click on .bat) package for the less experienced users. But both this and aborting the processing (also worth implementing - I agree on that) are separate issues / discussions, so let's stop it here. I consider img2img in current state as good enough for typical use cases, so I am closing this one :).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants