Commit Graph

245 Commits

Author SHA1 Message Date
Sanster
1812928887 make editor-toolkit-panel background color change between theme more smooth 2022-04-07 21:25:52 +08:00
Sanster
2d53f3cade fix .editor-toolkit-panel display issue in safari 2022-04-07 21:22:19 +08:00
Qing
3fc0008f0a
Merge pull request #30 from Sanster/PR25
PR25 + style refine
2022-04-06 23:05:30 +08:00
Sanster
10b35a3f0a style refine 2022-04-06 23:01:18 +08:00
blessedcoolant
855fd1f006
Merge branch 'Sanster:main' into recoil-refactor 2022-03-31 06:09:49 +13:00
blessedcoolant
ca9e393989 Inpainted State Fix 2022-03-30 19:14:32 +13:00
Sanster
251df40fc8 Revert "add imghdr to requirements.txt"
This reverts commit 81efda9df1.

fix https://github.com/Sanster/lama-cleaner/issues/27
2022-03-30 10:21:35 +08:00
blessedcoolant
b282421c98 Complete GUI Refactor # Patch 1 2022-03-30 12:45:34 +13:00
blessedcoolant
eea85b834e Complete GUI Refactor
This patch brings in a massive number of changes to the frontend of the application. Please feel free to discuss the proposed changes with me at any time.

Implemented Recoil as a state management system.
Why Recoil? It is a robust library built by developers at Facebook for state management. It has an  extremely simple API for implementation that is in sync with React syntax compared to any other state management system out there and works amazingly well. While the official release status is beta as it becomes fully featured, the library is already used in various systems at Facebook and is very stable for the use cases of this application.

Why global state management? One of the major issues I saw with the current file structure is that there is minimal code splitting and it makes further development of the frontend a cumbersome task. I have broken down the frontend into various easy to access components isolating the GUI from the logic. To avoid prop drilling, we need global state management to handle the necessary tasks. This will also facilitate the addition of any new features greatly.

Code Splitting. Majority of the components that can be isolated in the application have now been done so.
All New Custom CSS & Removal of Tailwind
While Tailwind is a great way to deploy beautiful interfaces quickly, anyone trying to stylize the application further needs to be familiar with Tailwind which makes it harder for more people to work on it. Not to mention, I am not a particular fan of flooding JSX elements with inline CSS classes. That makes reading the code extremely hard and bloats up component code drastically.

As a replacement to Tailwind, I implemented a custom styling system using SCSS as a developer dependency.

In the new system, all the general and shared styles are in the styles folder and all the component styles are in the same folder as the component for easy access.The _index.scss file now acts as a central import for every other stylesheet that needs to be loaded.

What Changed?
The entire application looks and feels like the current implementation with minimal changes.
The green (#bdff01) highlight used in the application has now been changed to a bright yellow (rgb(255, 190, 0)) because I felt it better suited the new Dark Mode (see below).
The swipe bar for comparing before and after images has now been removed and instead the comparison is a smooth fade effect. I felt this was better to analyze image changes rather than a swiper. // Can add the swipe back if needed.

Dark Mode
A brand new Dark Mode has been added for the application. Users can enable and disable by tapping the button in the header or by using the Shift + D hotkey.

Other Misc New Features
When the editor image is now zoomed out to its default size, the image now also gets centered back.

TODO
The currently used react-zoom-pinch-pan module is not mobile friendly. It does not allow brush strokes. Need to figure out a way to fix this.
Further optimization of the frontend code with better code splitting and performance.
When using the LaMa model, the first stroke has a delayed response from the backend but the ones that follow are almost immediate. I believe this is happening because of the initialization of the model on the first stroke. I wonder if either of us can look at it and see if this can somehow be preloaded so the user experience is smooth from the first stroke.
Enable threading for the desktop application mode so flaskwebgui does not block the main applications Python console.
2022-03-28 17:52:05 +13:00
blessedcoolant
a40d92f23f
Merge branch 'Sanster:main' into recoil-refactor 2022-03-28 04:41:24 +13:00
Qing
1a8d407782
Merge pull request #24 from Sanster/PR22
PR22
2022-03-27 13:58:35 +08:00
Sanster
6913ad169b yarn build 2022-03-27 13:56:23 +08:00
Sanster
d945a156ca update README 2022-03-27 13:55:27 +08:00
Sanster
a6f29be662 disable cache for fetch inputimage 2022-03-27 13:50:41 +08:00
Sanster
705e12d02d check --input before start server 2022-03-27 13:37:26 +08:00
Sanster
0cc17ea322 remove redundant parentheses 2022-03-27 13:21:04 +08:00
Sanster
ad0c68164d Revert "Launch and monitor both Python and JS during development"
This reverts commit 481e956c3a.

We can start python server with --debug
2022-03-27 13:17:13 +08:00
Sanster
81efda9df1 add imghdr to requirements.txt 2022-03-27 13:14:27 +08:00
blessedcoolant
b5c07b0dad
Merge pull request #3 from blessedcoolant/main
Merge with main
2022-03-26 04:10:35 +13:00
blessedcoolant
1ca0359eab Fixed wrong push 2022-03-25 14:06:03 +13:00
blessedcoolant
2e5590f74c Fixed missing dependency for useInputImage 2022-03-25 14:05:13 +13:00
blessedcoolant
7c7daf8ade Bug fixes
Fixed a few bugs from previous patch.

- Removed default value for --input tag. It was causing the front end to trigger a request and throw an error when there was no input given.
- Added a check to see if input is provided or not
- Converted the new hook to Typescript and added necessary types.
- Rebuilt to update to current changes.
2022-03-25 13:49:56 +13:00
blessedcoolant
a2d7851a40
Merge pull request #2 from blessedcoolant/user_input_image
User Input Image / Dev QoL Update
2022-03-25 07:47:55 +13:00
blessedcoolant
d0f025f2d4 Add User Input Image Support
Users can now supply the --input argument to load their image by default to the application.
2022-03-25 07:33:13 +13:00
blessedcoolant
481e956c3a Launch and monitor both Python and JS during development
No longer need to restart python each time any change is made. nodemon will handle that now. Using concurrently because I found it to be better performant than run-p.
2022-03-25 07:31:59 +13:00
blessedcoolant
085b517606 Cleanup
Removed some unused imports
2022-03-25 06:06:07 +13:00
blessedcoolant
785848b5ec
Fix crop trigger size not having a default value 2022-03-25 05:56:00 +13:00
Sanster
c3157b4e15 use cross-env for windows build 2022-03-24 21:48:45 +08:00
Sanster
1c997991e4 change --gui_size to --gui-size; use nargs for crop-trigger-size 2022-03-24 21:45:09 +08:00
Sanster
c5223008d5 update README 2022-03-24 21:36:47 +08:00
Sanster
cdfc0c0aba update .gitignore 2022-03-24 21:10:45 +08:00
Qing
8195646f52
Merge pull request #20 from blessedcoolant/main
Added desktop application mode
2022-03-24 21:10:00 +08:00
blessedcoolant
68616d0ebe
Merge branch 'main' into main 2022-03-24 16:31:29 +13:00
Sanster
d3f1ea2474 change crop-size to crop-margin, to add more context for crop infer 2022-03-24 09:08:49 +08:00
blessedcoolant
57bf1533ab
Update README.md 2022-03-24 05:12:16 +13:00
blessedcoolant
44e131f9ac Added desktop application mode
Run lama-cleaner as a desktop application.
2022-03-24 05:07:33 +13:00
Qing
1207b6e291
Merge pull request #19 from Sanster/add_crop_infer
add crop infor for lama
2022-03-23 10:15:57 +08:00
Sanster
43c9c22c73 add crop infor for lama 2022-03-23 10:15:23 +08:00
Sanster
a46424478a move time to main 2022-03-20 22:42:59 +08:00
Sanster
bb6580cc0c add benchmark.py 2022-03-20 22:40:36 +08:00
Qing
f813c59b66
Merge pull request #17 from Sanster/mr16
#16
2022-03-17 13:03:59 +08:00
blessedcoolant
3fac27712a New build with brush size hotkeys 2022-03-17 13:00:36 +08:00
blessedcoolant
ffd39a7300
Deleting the old build folder 2022-03-17 05:58:28 +13:00
blessedcoolant
3d90a934a0
Add Brush Change Hotkeys to Shortcuts Modal 2022-03-17 05:56:15 +13:00
blessedcoolant
a87dd87b8d
Add Standard Brush Size Hotkey Functionality
You can now use the bracket keys "[" and "]" to Increase and Decrease Brush Size similar to many other photo editing programs.
2022-03-17 05:54:58 +13:00
Sanster
61fcffda94 add torch.cuda.empty_cache() after model forward 2022-03-12 20:43:47 +08:00
Sanster
4e5903129c update README 2022-03-06 20:43:12 +08:00
Sanster
f9b96cf218 add ldm model 2022-03-06 20:29:45 +08:00
Sanster
f09d40cbef turnoff torchscript fuser feature
https://github.com/Sanster/lama-cleaner/issues/1
2022-02-18 13:30:20 +08:00
Qing
799ab7607b
Update README.md 2022-02-17 09:29:04 +08:00