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

[Big update] - Dynamic params, Ui rehaul, mobile fixes, and simplification of the txt2img tab #421

Merged
merged 7 commits into from
Sep 1, 2022

Conversation

altryne
Copy link
Contributor

@altryne altryne commented Sep 1, 2022

I've rewritten this feature like 3 times but I'm so glad I added it.
CleanShot 2022-09-01 at 00 58 22

I give you: dynamic params

You can now control the basics params right from the input box, and they will update in the system :

CleanShot 2022-09-01 at 00 43 13

This also means, we can copy paste and load most of the params from both the old SD discord bot replies and the new gobot replies

This also means, users are free to specify whichever params they want outside of our defaults.

Supports many way users can think about params
width:124 or -W 234 or --cfg-scale 123 etc etc

Revamped output box, with simplified UI and colorful tags for params :

CleanShot 2022-09-01 at 00 46 26@2x

Mobile responsoive support and prompt input changes: (not even dreamstudio has this!)

  • The input now switches to multiline when the prompt is too big, to support the longer prompts.
  • Mobile now looks much better, the results are close to the prompt and the propt is multiline
  • Added a subsection in css for mobile fixes and fixed button rows

CleanShot 2022-09-01 at 00 47 50@2x

Quality of life changes and sensible defaults

  • Hid the batch_* thing inside advnaced settings (as this screws most users up and confuses them)
  • renamed the batch_size to number (like in dreamstudio) and it's scroll size is much nicer now
  • Lowered the basic width / height to 1024 (let's admit, most folks can't generate higher than that)
  • Updated the playground to generate rando images with supporting the provided width and height

TODOS - post merge:
Restore the aspect ratio calculation
Restore the loader css missing.
Sleep

@altryne altryne added enhancement New feature or request txt2img Related to txt2img labels Sep 1, 2022
@altryne altryne added this to the txt2img ui 0.1 milestone Sep 1, 2022
@altryne altryne requested a review from hlky September 1, 2022 06:55
@hlky
Copy link
Contributor

hlky commented Sep 1, 2022

Conflict from #381 will look at shortly

@devilismyfriend
Copy link
Contributor

looks fantastic

@hlky
Copy link
Contributor

hlky commented Sep 1, 2022

It's working in my tests, except the buttons for copy to clipboard and upscale w/ esrgan

Had to fix some things, going to merge those changes to this branch now

msedge_7OnjxCzF18.mp4

@JohannesGaessler
Copy link
Contributor

Question regarding this PR:
It does not implement anything regarding automatically loading in settings, right?
(I just opened a PR with this goal.)

@hlky
Copy link
Contributor

hlky commented Sep 1, 2022

Not yet @JohannesGaessler

If you could test the branch as well I could just temporarily remove the upscale w/ esrgan and copy to clipboard (the image one) buttons to get this out on main sooner

@nderscore
Copy link
Contributor

nderscore commented Sep 1, 2022

I would recommend to enforce that at least one hyphen prefix is used (really two would be ideal) to avoid accidentally writing that parameter syntax in a prompt unexpectedly:

This is a contrived example prompt that would have an issue with a full width 1970's photograph

@hlky
Copy link
Contributor

hlky commented Sep 1, 2022

@nderscore I think -- would be better too

Checked and copy to clipboard for the image worked before, the original pr from @altryne appeared to have the function missing, I'll have another look
but i'm keen to get this pushed because it appears to have fixed img2img, haven't checked what the difference is regarding that, with this branch I did push to img2img then generate and it worked so

00442-26_k_euler_184103370_a_corgi

00166-40_k_euler_2794945641_a_corgi_wearing_a_top_hat

I did notice the default cfg scale is 5 on img2img which is too low, I think some users are reluctant to play around with the settings so the defaults for img2img are definitely something that need looking at, with cfg scale 5 the differences were negligible which is actually a source of complaints (img2img doesnt do anything).

Below is the cfg scale 5, it was k_lms too instead of k_euler but lms and euler produce comparable results so its the cfg scale imo

00165-50_k_lms_88986824_a_corgi_wearing_a_top_hat

@hlky
Copy link
Contributor

hlky commented Sep 1, 2022

image

@hlky
Copy link
Contributor

hlky commented Sep 1, 2022

Yeah im gonna push this asap and just deal with the complaints about the copy to clipboard after, because img2img working is more important

@hlky hlky merged commit 45fafec into master Sep 1, 2022
@altryne
Copy link
Contributor Author

altryne commented Sep 1, 2022

I would recommend to enforce that at least one hyphen prefix is used (really two would be ideal) to avoid accidentally writing that parameter syntax in a prompt unexpectedly:

This is a contrived example prompt that would have an issue with a full width 1970's photograph

Thanks @nderscore wanted to tag you for review.
I started with just the old params way like in the command line and in the old SD discord bot:

CleanShot 2022-09-01 at 07 17 44@2x

Then during my work they released a new way, with gobot which.. makes more sense to me and separates with : and has normal words

CleanShot 2022-09-01 at 07 18 28@2x

So then I combined the two... and I agree it can disappear some combinations, but I wasn't about to write two regexes per param .

Then I did a for loop lol, and... I made it, but the code was... so incredible ugly, it was a template string, inside a regex, inside a python file ..

This needs a fresh set of eyes for sure, but I think let's see what folks think

@nderscore
Copy link
Contributor

nderscore commented Sep 1, 2022

Then during my work they released a new way, with gobot which.. makes more sense to me and separates with : and has normal words

That syntax makes more sense on Discord, where they have a custom UI for entering command arguments, and that syntax only always used with a /slash command

Using : syntax also directly conflicts with using : as a separator for weighted prompts.

@JohannesGaessler
Copy link
Contributor

@hlky I'm not sure what you were trying to tell me.
(I never used RealESRGAN so I went ahead and set it up in case I was missing something.)
In any case, I'm in no particular rush and I have no problem just rebasing my PR onto master once it's ready (currently a draft).

@JohannesGaessler
Copy link
Contributor

I just pulled from master after this PR was merged.
When I generate test images each image is being displayed twice in the GUI (only saved to disk once).
Is this a known issue?

@hlky
Copy link
Contributor

hlky commented Sep 1, 2022

Yeah, it's the grid image, I had previously fixed this because it's not 100% clear when making 1 image, must have got added back in.

The fix was to not add grid to Gradio Gallery output if count is 1, another addition could be do not generate/save grid at all if only 1 image is made

@JohannesGaessler
Copy link
Contributor

Also a question regarding "variation_amount" and "variation_seed":
Should they not be included in the text that is copied to clipboard when the button "Copy full parameters" is pressed?
(I think something else with RealESRGAN was meant by clipboard issues in this discussion.)

@JohannesGaessler
Copy link
Contributor

@hlky To clarify, this is what my UI looks like when I generate two images:

Screenshot_20220901_155013

These don't seem to be grids but actual duplicates.

@lashmanRB
Copy link

lashmanRB commented Sep 1, 2022

yup, same thing's happening for me:

image

the actual files on disk aren't being doubled, just the gallery display and the grid image


also - would be nice if the number of images slider could go up a bit higher, to 16

@JuanLagu
Copy link
Contributor

JuanLagu commented Sep 7, 2022

Hello @altryne 👋
Is there a reason the txt2img aspect ratio calculation hasn't been restored yet? Was it causing any problem?

txt2img_width.change(fn=uifn.update_dimensions_info, inputs=[txt2img_width, txt2img_height], outputs=txt2img_dimensions_info_text_box)

txt2img_height.change(fn=uifn.update_dimensions_info, inputs=[txt2img_width, txt2img_height], outputs=txt2img_dimensions_info_text_box)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request txt2img Related to txt2img
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants