add lcm realtime canvas painting
Fixes https://github.com/lllyasviel/Fooocus/issues/990
This feature introduces a new tab with a canvas to act as alternative input for uov_input_image with vary strong.
It's recommended to use this with arg --highvram to further reduce generation time.
This feature will cause the shortcut for inpaint to become invalid after updating gradio, and images in the gallery cannot be clicked for fullscreen.
@diaolulu1 thank you for pointing that out, will try to check it with gradio v3.45.0. Please keep me posted if you already tried this version.
I tried your enhancement, that's excellent! Thanks for your contribution. I also found something improvable:
- When enable realtime painting, it's better set the image numbers to 1 automatically. That's more reasonable for realtime scenario.
- After adding several objects, seems the previousely painted objects get ignored.
- The default background color is white, when drawing on the cavas, the background color seems always reconized as user input. E.g., if I input text prompt "moutains", the white part will be rendered as snow. Maybe should not pass the background as image prompt.
@thiner this feature might already be superseded by SDXL Turbo.
- this is absolutely reasonable, adjusted in last commit
- the generation only happens after the button is interactive again as changing the canvas triggers a javascript click of the button. I couldn't find a better solution but this still seems to be a bit hacky. Feel free to suggest a better way without code duplication + while still being able to maintain the button code.
- this is in the nature of image generation with img2img ^^
@diaolulu1 there is a hardcoded svelte class which changed after updating gradio. Please test again if it works for you now as well.
@diaolulu1 there is a hardcoded svelte class which changed after updating gradio. Please test again if it works for you now as well.
I've tried the latest modification, the shortcut issue with the inpaint canvas has been fixed, but the images in the gallery preview window still can't be fullscreened after clicking.
At the start of each drawing session, Fooocus loads the model into the VRAM, which certainly wastes time. Is it possible to keep the model constantly in VRAM when in the realtime canvas mode?
It seems unnecessary to upgrade gradio to 3.50.2 as the live canvas still operates normally and all bugs are non-existent.
@diaolulu1 there is a hardcoded svelte class which changed after updating gradio. Please test again if it works for you now as well.
I have encountered a problem on the server side with this Gradio upgrade. The issue is the same as https://github.com/lllyasviel/Fooocus/issues/728#issue-1949233833
I fixed the problem by downgrade Gradio version from 3.50.2 to 3.45.0.
@diaolulu1 yes, this is indeed possible. As mentioned in the PR description it is advised to use the argument --highvram to keep the model in VRAM and reduce generaton time. Please give it a shot.
Upgrading Gradio is necessary (at least to 3.45.0) as only updated versions include support for updating image shape. See https://github.com/gradio-app/gradio/issues/5019 and commit message https://github.com/mashb1t/Fooocus/commit/bed48beb272b6f60fbe414fd1d7e5db2058947ed
@thiner ok, then let's downgrade to 3.45.0
I've found that the resolution of the real-time canvas doesn't change when I modify the resolution settings.
@diaolulu1 tested it on mobile and desktop viewports in both Chrome and Firefox and all combinations are working fine. Can you please make a screencast and attach it here to figure out what the problems are? Are there any issues in the browser console when switching aspect ratios?
@diaolulu1 tested it on mobile and desktop viewports in both Chrome and Firefox and all combinations are working fine. Can you please make a screencast and attach it here to figure out what the problems are? Are there any issues in the browser console when switching aspect ratios?
It was my mistake, my gradio was still at version 3.41.2. My issue is now resolved, thank you very much!
простите, уважаемые, вы где такие версии нашли > 3.41.0 ?
Aug 24, 2023 @github-actions github-actions v3.41.0 https://github.com/gradio-app/gradio/commit/ba4c6d9e65138c97062d1757d2a588c4fc449daa Compare v3.41.0
@usliders see https://pypi.org/project/gradio/#history