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

feat: adds preview overlay for styles #1762

Merged
merged 8 commits into from
Jan 7, 2024
Merged

Conversation

crohrer
Copy link
Contributor

@crohrer crohrer commented Jan 5, 2024

closes #1743

this includes sample images from #1749 and displays them in an overlay on mouseover.

Copy link
Collaborator

@mashb1t mashb1t left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, 100% implements requested enhancement in #1743 👍

Screenshot 2024-01-05 at 17 11 08

@mashb1t mashb1t mentioned this pull request Jan 5, 2024
@diaolulu1
Copy link

I am unable to display images here, only a transparent box is shown.

360截图20240106010346546

@mashb1t
Copy link
Collaborator

mashb1t commented Jan 5, 2024

@diaolulu1 please check your network tab, this may have to do with slow internet speed between you and the server (if you're using Fooocus remotely).
If that isn't the case please check if the meta samples-path is correctly set to your project root, see screenshot attached:

Screenshot 2024-01-05 at 18 19 24

@docppp

This comment was marked as resolved.

@mashb1t

This comment was marked as resolved.

@diaolulu1
Copy link

@diaolulu1 please check your network tab, this may have to do with slow internet speed between you and the server (if you're using Fooocus remotely). If that isn't the case please check if the meta samples-path is correctly set to your project root, see screenshot attached:

Screenshot 2024-01-05 at 18 19 24

0240106013659182
20240106013750200

@mashb1t
Copy link
Collaborator

mashb1t commented Jan 5, 2024

@diaolulu1 please check your network tab, this may have to do with slow internet speed between you and the server (if you're using Fooocus remotely). If that isn't the case please check if the meta samples-path is correctly set to your project root, see screenshot attached:

Screenshot 2024-01-05 at 18 19 24

@diaolulu1 I see your code is unchanged and should work. Please check the browser network tab for any requests and the browser page source code at samples-path to help debug this.

@diaolulu1
Copy link

@diaolulu1 please check your network tab, this may have to do with slow internet speed between you and the server (if you're using Fooocus remotely). If that isn't the case please check if the meta samples-path is correctly set to your project root, see screenshot attached:
Screenshot 2024-01-05 at 18 19 24

@diaolulu1 I see your code is unchanged and should work. Please check the browser network tab for any requests and the browser page source code at samples-path to help debug this.

I apologize for not understanding you earlier, but now I do. I have checked the webpage source code, and the address is correct. Using that address, I was able to successfully open the image in the file explorer.
20240106020401003

Copy link
Collaborator

@mashb1t mashb1t left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@diaolulu1 i can confirm that it is not working on Windows as the paths are wrong.
@crohrer please ensure both Windows and Linux/MacOS paths are working correctly for preview images.

@mashb1t
Copy link
Collaborator

mashb1t commented Jan 5, 2024

@diaolulu1 fixed & tested for both Windows and MacOS, please check again

@hswlab

This comment was marked as off-topic.

@mashb1t

This comment was marked as off-topic.

@JulienZLQ
Copy link

After trying, it can meet the preview effect, but after using a non-native language, the inconsistent page text and the picture file name will not take effect. It cannot be automatically associated and matched from the source. I need to change the file name of the picture one by one.

@diaolulu1
Copy link

@diaolulu1 fixed & tested for both Windows and MacOS, please check again

Thank you very much for your modification; the program is now running normally, but only in English. If switched to Chinese or other languages, it cannot adapt properly. The image filenames need to be changed to the corresponding language, which cannot guarantee universality.

01
02

@crohrer
Copy link
Contributor Author

crohrer commented Jan 6, 2024

I implemented support for other languages. I hope it works for everyone

@docppp
Copy link
Contributor

docppp commented Jan 6, 2024

Changes from this PR are now reflected in #1749

@simartem
Copy link

simartem commented Jan 6, 2024

LEGEND!

Copy link
Collaborator

@mashb1t mashb1t left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the adjustment, works for me on both Windows and MacOS using various different languages, incl. default.

@diaolulu1
Copy link

diaolulu1 commented Jan 6, 2024

Great!Thanks for your job!

Copy link
Contributor

@docppp docppp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If preview overlay will be merged without log-like page, log.html should be removed.

@mashb1t
Copy link
Collaborator

mashb1t commented Jan 6, 2024

@docppp i assume you mean that the PR #1749 can then be closed, right?

@docppp
Copy link
Contributor

docppp commented Jan 6, 2024

@mashb1t Not exactly, as per my understanding, the is no decision yet if only tooltip (this PR) or #1749 will be merged. If it happens, that this one get the green light, then sdxl_styles/samples/log.html file is useless.

@lllyasviel
Copy link
Owner

lllyasviel commented Jan 6, 2024

i am going to merge.
but still need to consider that increased file size of this repo since the auto update will pull all files.
i will see if i can make extra files smaller or so

@simartem
Copy link

simartem commented Jan 7, 2024

ged without log-like

I dont if its someway technically possible (just like downloading the default model after the code is run on local) but instead of pulling all sample style images, script will download external sample/images from an external cloud link and put them in the required folder on first run, after user upgraded to new version. So that the original software size will remain same.

reduces file size from 19,6MB to 3,4MB
@mashb1t
Copy link
Collaborator

mashb1t commented Jan 7, 2024

@lllyasviel i've scale down the images to Retina resolution (2x displayed res), fixed the aspect ratio and applied jpeg compression. This reduces the file size from 19,6MB to 3,4MB.

@hswlab hswlab mentioned this pull request Jan 7, 2024
@xhoxye
Copy link
Contributor

xhoxye commented Jan 7, 2024

@lllyasviel i've scale down the images to Retina resolution (2x displayed res), fixed the aspect ratio and applied jpeg compression. This reduces the file size from 19,6MB to 3,4MB.

Is it possible to save small pictures but display large ones?
130 x100 px ,Is this size too small?

@mashb1t
Copy link
Collaborator

mashb1t commented Jan 7, 2024

Is it possible to save small pictures but display large ones? 130 x100 px ,Is this size too small?

Yes, you can bump the css width and height e.g. x2, but keep in mind that quality will decrease from higher res. than 260x200.
In general, it's best practice to keep images with x2 resolution than displayed (retina).

I personally would really like to keep it small (current 130x100px):

  • saves disk space
  • is sufficient to get a preview
  • great on mobile devices / viewports

@lllyasviel lllyasviel merged commit f298ebc into lllyasviel:main Jan 7, 2024
@mashb1t
Copy link
Collaborator

mashb1t commented Jan 8, 2024

@lllyasviel Is it intended that the images are now smaller in dimensions and >200% larger in file size? Did you compress the images after downscaling?

In general, it's best practice to keep images with x2 resolution than displayed (retina).

As mentioned, it is best practice to keep images x2 the display size for upscaled outputs, so 256x256 would be ideal here when displaying as 128x128px.

@mashb1t
Copy link
Collaborator

mashb1t commented Jan 8, 2024

Some files were not correctly renamed, please merge the changes of #1809

@GoldMath
Copy link

GoldMath commented Jan 8, 2024

Thanks for the addition, I just noticed that small issue reported here with the thumbnails at the bottom at the windows

Minor UI issue with image preview in Style when mouse hover at the bottom #1816

EDIT: Fixed #1829

@Kyl329

This comment was marked as off-topic.

machineminded pushed a commit to machineminded/Fooocus-inswapper that referenced this pull request Jan 12, 2024
* feat: adds preview overlay for styles

* fix: implement correct path resolution for all OS

solves issues for Windows

* fix: makes preview overlay also work with other languages

* feat: scale down images to 258x200, fix aspect ratio in css

reduces file size from 19,6MB to 3,4MB

* fix: adjust z-index to correctly overlay gradio border pulse when generating images

* update files

* version

---------

Co-authored-by: Manuel Schmid <[email protected]>
Co-authored-by: Manuel Schmid <[email protected]>
Co-authored-by: lllyasviel <[email protected]>
xizzat added a commit to xizzat/Fooocus-Extra that referenced this pull request Feb 14, 2024
* add inswapper integration

* update docs

* add usage video

* Update readme.md

* Update readme.md

* Update readme.md

* add missing requirements

* Update readme.md

* Update readme.md

* add inswapper integration

* update docs

* add usage video

* Update readme.md

* Update readme.md

* Update readme.md

* feat: adds preview overlay for styles (lllyasviel#1762)

* feat: adds preview overlay for styles

* fix: implement correct path resolution for all OS

solves issues for Windows

* fix: makes preview overlay also work with other languages

* feat: scale down images to 258x200, fix aspect ratio in css

reduces file size from 19,6MB to 3,4MB

* fix: adjust z-index to correctly overlay gradio border pulse when generating images

* update files

* version

---------

Co-authored-by: Manuel Schmid <[email protected]>
Co-authored-by: Manuel Schmid <[email protected]>
Co-authored-by: lllyasviel <[email protected]>

* fix lllyasviel#1807 (lllyasviel#1814)

* fix --disable-in-browser (lllyasviel#1718)

* git is now case sensitive (lllyasviel#1820)

* Update Version (lllyasviel#1821)

* fix: prevent cutting off overlay (lllyasviel#1829)

Co-authored-by: Christoph Rohrer <[email protected]>

* add missing requirements

* Update readme.md

* Update readme.md

* add ability to provide the target image index

* update .gitignore

* fix an issues passing input values

* add info text to target index input

* update docs with usage

* Update readme.md

* first cut of diffusers based photomaker code

* more progress, crummy images

* remove styles for now; troubleshooting poor quality

* first cut of preview code; add resolution

* clean up preview stuff

* pass guidance scale, add callback for preview

* comment out some instant id stuff; use prompts from fooocus

* load loras, update logging; add stuff to todos

* trying to get multiple LoRAs working

* add comments for fixing photomaker progress images

* add mechanism for selecting sampler/scheduler

* add some readme.md for photomaker

* clean up logging

* typos

* add some comments

* pass async_task for progress

* default to DDIM

* resolves issue #1

where swapped face outputs were not saved to the directory

* check the image type then save accordingly

* update readme.md

* unload diffusers when photomaker is disabled

* update docs

* update readme.md

* update readme.md

* remove photomaker folder

* add back photomaker folder with files

* add configure.sh, update colab notebook

* fix notebook

* chmod +x on configure.sh

* add configure.sh

* Update readme.md

* add chmod, call the configure.sh script

* Update readme.md

* update readme with photomaker memory requirements

* add ability to cancel diffusers pipeline

* allow more than four photomaker images

* change verbiage on photomaker readme.md

* remove torch and torchvision from requirements

* first cut of instantid code

* add lcm support; get ready for instantid inpainting

* fix merge syntax

---------

Co-authored-by: Jared Dietz <[email protected]>
Co-authored-by: machineminded <[email protected]>
Co-authored-by: Chris Rohrer <[email protected]>
Co-authored-by: Manuel Schmid <[email protected]>
Co-authored-by: Manuel Schmid <[email protected]>
Co-authored-by: lllyasviel <[email protected]>
Co-authored-by: cocktailpeanut <[email protected]>
Co-authored-by: Christoph Rohrer <[email protected]>
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

Successfully merging this pull request may close these issues.

Request for feature : Preview of style on mouse over (hover)