Commit Graph

299 Commits

Author SHA1 Message Date
Qing
55197f2209 frontend: better error handling 2022-06-12 13:13:51 +08:00
Qing
7826bda89c yarn build 2022-05-30 10:51:34 +08:00
Qing
544da231f6 fix sizeLimit reset after inpainting 2022-05-30 10:51:34 +08:00
Qing
e4a6c91f4a enable fp16 for ldm by default 2022-05-30 10:51:34 +08:00
Qing
1d9b9d05e1 yarn build 2022-05-23 21:16:59 +08:00
Qing
45d1cc3f35 optimize shortcuts style 2022-05-22 13:32:19 +08:00
Qing
b7c3f3e327 update radix-ui dialog select version 2022-05-21 15:13:09 +08:00
Qing
ad62ef492e tooltip add delay 2022-05-21 13:37:38 +08:00
Sanster
22834a8243 button tooltip from b90e32886a 2022-05-21 13:04:35 +08:00
blessedcoolant
92900933e5 minor patch
- Added hotkey for manual inpaint: Shift +  R (Updated the hotkey list to display this)
- Moved Settings icon in the header to the end which is consistent with how most programs do it.
- Fixed some missing useEffect dependencies.
- Made the formatting of the Shorcut description text consistent.
- Removed the borders around the bottom toolkit buttons. The 1px border was choppy and the entire region was looking boxed and cluttered. Now I feel it looks cleaner and is consistent with the button in the header.
2022-05-21 12:59:33 +08:00
Sanster
a297a6d3d0 radix select 2022-05-02 13:58:40 +08:00
Sanster
bf1e990f00 support panning using wheel 2022-04-27 17:30:28 +08:00
Sanster
390933f0eb prevent right click on canvas work 2022-04-27 17:23:01 +08:00
Sanster
3580d4281f show brush while change slide 2022-04-27 17:19:44 +08:00
Sanster
00381ceaa2 yarn build 2022-04-24 22:40:34 +08:00
Sanster
bbacb99e9d fix resize drawRender issue 2022-04-24 21:52:41 +08:00
Sanster
bbeefba7c5 fix Escape clear drawing 2022-04-24 21:41:04 +08:00
Sanster
dad1276ea7 header add background-color 2022-04-24 21:22:42 +08:00
Sanster
1bc3f06190 enable resetZoom after panning 2022-04-23 20:26:45 +08:00
Sanster
2797d2aca7 tool bar add shadow 2022-04-23 20:23:57 +08:00
Sanster
ce0c7defe1 make undo stroke in manual mode 2022-04-23 20:22:05 +08:00
Sanster
f97e17a593 add manual run mode 2022-04-23 20:21:34 +08:00
Sanster
1bfdec4acf yarn build 2022-04-19 21:35:52 +08:00
Sanster
6fb3d91082 fix tool panel bg
https://github.com/Sanster/lama-cleaner/issues/39
2022-04-19 21:32:04 +08:00
Sanster
2db38a20b4 fix bug in: https://github.com/Sanster/lama-cleaner/issues/40\#issue-1207371759 2022-04-19 17:24:40 +08:00
Sanster
0b5494d1f8 use flask1, flask2 require python3.7 2022-04-18 22:54:34 +08:00
Sanster
b6a5650a96 fix --gui 2022-04-18 22:28:47 +08:00
Sanster
c283b05b8e yarn build 2022-04-18 22:19:33 +08:00
Sanster
0b5130420b initial settings atom from localStorage 2022-04-18 22:05:05 +08:00
Sanster
67befef3c7 disable flask warning 2022-04-18 21:30:49 +08:00
Sanster
71599e9c6d filter flaskwebgui log 2022-04-18 15:29:29 +08:00
Sanster
a219da27f7 add setup.py 2022-04-18 15:15:51 +08:00
Sanster
f7e1e073dc make model switch work with toast 2022-04-18 08:46:19 +08:00
Sanster
205286a414 big update 2022-04-16 21:29:18 +08:00
Sanster
2b031603ed save useInputImage with correct filename 2022-04-14 22:22:18 +08:00
Sanster
78d6b1cc3e wip: add setting page 2022-04-14 20:43:07 +08:00
Sanster
aa411c7524 WIP 2022-04-12 20:58:57 +08:00
Sanster
e570e85e64 fix jumpy image load 2022-04-09 22:45:48 +08:00
Sanster
1b1aade067 fix png alpha channel lose 2022-04-09 08:12:41 +08:00
Sanster
caed45b520 return correct file ext/mimetype 2022-04-09 07:23:33 +08:00
blessedcoolant
e3e151716c new build 2022-04-08 17:05:58 +12:00
blessedcoolant
4d118698b4 Fix bug with Shortcuts Modal & added missing useEffect dependencies 2022-04-08 17:04:55 +12:00
Sanster
c3315a2d2b prevent ShortcutsModal bouncing offset 2022-04-07 21:38:10 +08:00
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
Sanster
10b35a3f0a style refine 2022-04-06 23:01:18 +08:00
blessedcoolant
ca9e393989 Inpainted State Fix 2022-03-30 19:14:32 +13: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
Sanster
6913ad169b yarn build 2022-03-27 13:56:23 +08:00
Sanster
a6f29be662 disable cache for fetch inputimage 2022-03-27 13:50:41 +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
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
Sanster
c3157b4e15 use cross-env for windows build 2022-03-24 21:48:45 +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
44e131f9ac Added desktop application mode
Run lama-cleaner as a desktop application.
2022-03-24 05:07:33 +13: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
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
f9b96cf218 add ldm model 2022-03-06 20:29:45 +08:00
Sanster
5f8b23cd4f 0.4.0 build 2022-02-09 18:12:22 +08:00
Sanster
5450fd2234 download small size image 2022-02-09 18:01:19 +08:00
Sanster
c5f4accbff fix brush size after zoom 2022-02-08 22:36:32 +08:00
Sanster
4e213e64e1 add undo shortcuts 2022-02-08 21:57:11 +08:00
Sanster
568a83b732 only show valid size in SizeSelector 2022-02-08 21:55:09 +08:00
Sanster
38010a9556 Modal add Esc shortcut 2022-02-08 21:41:47 +08:00
Sanster
3db21e7e95 add keyboard shortcuts 2022-02-07 22:25:24 +08:00
Sanster
56238c5068 SizeSelector only show smaller size 2022-02-07 21:08:38 +08:00
Sanster
8ae3d8a42c change SizeSelector size 2022-02-06 22:06:07 +08:00
Sanster
c81fc0ecfc hold space to pan 2022-02-06 22:02:44 +08:00
Sanster
e26fddd936 wip add help button 2022-02-06 21:53:30 +08:00
Sanster
0814b07ef9 add reset button 2022-02-06 21:40:49 +08:00
Sanster
b4dc7a0253 disable ListBox space shotcut 2022-02-06 21:32:54 +08:00
Sanster
df53f81032 change style 2022-02-06 20:56:40 +08:00
Sanster
028a63ea34 use space to toggle pan mode 2022-02-06 19:52:45 +08:00
Sanster
e68f409003 add Tab hotKey for view origin image 2022-02-06 19:27:49 +08:00
Sanster
33c893746e Make Esc work for stop drawing 2022-02-06 13:50:26 +08:00
Sanster
31a00813e0 make Esc reset zoom work 2022-02-06 11:00:53 +08:00
Sanster
79ccd94ced make zoom work 2022-02-06 10:37:22 +08:00
Sanster
8013fc554f by default show undo and check original button 2022-02-05 21:50:01 +08:00
Sanster
8eeb350f49 use ListBox for size select 2022-02-05 21:41:32 +08:00
Sanster
920bf27ccb fix bottom area select problem 2022-02-05 20:14:18 +08:00
Sanster
c09ac0c17a build app 2021-12-12 14:57:10 +08:00
Sanster
06522a5f91 add multi stroke 2021-12-12 14:42:43 +08:00
Qing
1b2f2e2d65 remove map;build app 2021-11-30 13:24:53 +08:00
Qing
1e2c8fd348 resize image using backend;add resize radio button
frontend resize image will reduce image quality
2021-11-30 13:24:52 +08:00
Qing
1c2e7fa559 remove resize on frontend 2021-11-30 13:24:50 +08:00
Loreto Parisi
e839a36503 Added Dockerfile 2021-11-15 20:11:46 +01:00
wq.chu
4e027f81e6 init 2021-11-15 22:21:01 +08:00