Commit Graph

28 Commits

Author SHA1 Message Date
Dr.Lt.Data
075fd23962 improve: lightweight preview to reduce network traffic (#733)
* To reduce bandwidth traffic in a remote environment, a lossy compression-based preview mode is provided for displaying simple visualizations in node-based widgets.

* Added 'preview=[image format]' option to the '/view' API.
* Updated node to use preview for displaying images as widgets.
* Excluded preview usage in the open image, save image, mask editor where the original data is required.

* Made preview_format parameterizable for extensibility.

* default preview format changed: jpeg -> webp

* Support advanced preview_format option.
- grayscale option for visual debugging
- quality option for aggressive reducing

L?;format;quality?

ex)
jpeg => rgb, jpeg, quality 90
L;webp;80 => grayscale, webp, quality 80
L;png => grayscale, png, quality 90
webp;50 => rgb, webp, quality 50

* move comment

* * add settings for preview_format
* default value is ''(= don't reencode)

---------

Co-authored-by: Lt.Dr.Data <lt.dr.data@gmail.com>
2023-06-05 01:49:43 -04:00
malern
85cac6c46d Make multiline widget work with different canvas dimensions.
It now scales the textarea positioning using the canvas height/width.
2023-05-19 19:57:15 +01:00
comfyanonymous
108b69e50f Remove print. 2023-05-16 11:55:16 -04:00
comfyanonymous
c7903e72ad Add control_after_generate to combo primitive. 2023-05-16 03:18:11 -04:00
comfyanonymous
7e151778a3 Masked editor changes.
Add a way to upload to subfolders.

Clean up code.

Fix some issues.
2023-05-08 14:37:51 -04:00
Dr.Lt.Data
4c259c71e5 Clipspace Menu and MaskEditor application. (#548)
* Add clipspace feature.
* feat: copy content to clipspace
* feat: paste content from clipspace

Extend validation to allow for validating annotated_path in addition to other parameters.

Add support for annotated_filepath in folder_paths function.

Generalize the '/upload/image' API to allow for uploading images to the 'input', 'temp', or 'output' directories.

* rename contentClipboard -> clipspace

* Do deep copy for imgs on copy to clipspace.

* mask painting on clipspace

* add original_imgs into clipspace
* Preserve the original image when 'imgs' are modified

* robust patch & refactoring folder_paths about annotated_filepath

* wip

* Only show the Paste menu if the ComfyApp.clipspace is not empty

* clipspace feature added
maskeditor feature added

* instant refresh on paste

force triggering 'changed' on paste action

* enhance mask painting

smooth drawing
add brush_size +/- button

* robust patch

use mouseup event

* robust patch

again...

* subfolder fix on paste logic

attach subfolder if subfolder isn't empty

* event listener patch

add ], [ key event for brush size
remove listener on close

* Fix button positioning issue related to window height.
Change brush size from button to slider.

* clean commit

* clean code

* various bug fixes

* paste action
- prevent opening upload popup
- ensure rendering after widget_value update

* view api update
- support annotated_filepath

* maskeditor layout
- prevent covering button by hidden div

* remove dbg message

* Add cursor functionality to display brush size

* refactor: Replace brush preview feature with missionfloyd implementation

* missionfloyd implementation
* hiding brush preview off the canvas
* change brush size on wheel event

* keyup -> keydown event

* Update web/extensions/core/maskeditor.js

Co-authored-by: missionfloyd <missionfloyd@users.noreply.github.com>

* Add support for channel-specific image data retrieval in /view API to fix alpha mask loading issue

When loading an image with an alpha mask in JavaScript canvas, there is an issue where the alpha and RGB channels are premultiplied. To avoid reliance on JavaScript canvas, I added support for channel-specific image data retrieval in the "/view" API. This allows us to retrieve data for each channel separately and fix the alpha mask loading issue. The changes have been committed to the repository.

* Enable brush preview for key and slider events

* optimize

* preview fix

* robust patch

* fix copy (clipspace) action
imgs[0] copy -> whole imgs copy

* support batch images on clipspace, maskeditor

* copy/paste bug fixes for batch images
enhance selector preview on clipspace menu
add img_paste_mode option into clipspace menu

* crash fix

* print message if clipspace content cannot editable

* Update web/extensions/core/maskeditor.js

Co-authored-by: missionfloyd <missionfloyd@users.noreply.github.com>

* make default img_paste_mode to 'selected'

refactor space -> tab

* save clipspace files to input/clipspace instead of temp

* show "clipspace/filename.png" instead of 'filename.png [clipspace]' in LoadImage/LoadImageMask

* refresh fix related to FILE_COMBO

* Update web/extensions/core/maskeditor.js

Co-authored-by: missionfloyd <missionfloyd@users.noreply.github.com>

* Update web/extensions/core/maskeditor.js

Co-authored-by: missionfloyd <missionfloyd@users.noreply.github.com>

* adjust margin based on missionfloyd impelements

* mouse event -> pointer event

* pen, touch, mouse drawing patched and tested

* Update web/extensions/core/maskeditor.js

Co-authored-by: missionfloyd <missionfloyd@users.noreply.github.com>

* add comment about touch event.

---------

Co-authored-by: Lt.Dr.Data <lt.dr.data@gmail.com>
Co-authored-by: missionfloyd <missionfloyd@users.noreply.github.com>
2023-05-08 14:37:36 -04:00
pythongosssss
b0da0a9f5b automatic calculation of image pos from widgets 2023-05-04 19:42:07 +01:00
Jake D
281ddc671e Colored MultilineWidget (#524)
* fixes colors and z-index

* light mode fix

* Update widgets.js
2023-04-26 01:22:36 -04:00
comfyanonymous
eaf858df78 Auto increase the size of the image upload widget when there's an image. 2023-04-24 18:13:18 -04:00
FizzleDorf
b062f87a7e Seed controls added to Ksamplers (#296)
Co-authored-by: flyingshutter <flyingshutter@users.noreply.github.com>
2023-04-12 20:57:13 -04:00
comfyanonymous
f4e478eb4c Add webp images to upload accept list. 2023-04-06 22:22:59 -04:00
comfyanonymous
c508c37871 Fix seed being impossible to increment/decrement by 1. 2023-03-25 11:12:03 -04:00
pythongosssss
028e32bd91 Added support for converting widgets to inputs (and back) 2023-03-23 21:37:19 +00:00
pythongosssss
631c090fda tidy 2023-03-22 18:52:24 +00:00
pythongosssss
ff9c7e03ff Remove initial call as now unnecessary
Set canvas to dirty if we grow the node
2023-03-22 18:50:45 +00:00
pythongosssss
49ba9e32d9 Calculate sizes when drawing if required 2023-03-22 18:43:43 +00:00
pythongosssss
a039d44fe6 Add support for multiple multiline text areas on the same widget 2023-03-21 21:34:00 +00:00
Guo Y.K
417590e775 ui: hide decimal fraction for int fields 2023-03-21 17:48:00 +08:00
comfyanonymous
8cdef9e8a1 Merge branch 'save-images' of https://github.com/m957ymj75urz/ComfyUI 2023-03-20 14:29:45 -04:00
m957ymj75urz
0581bd923f rework payload from server 2023-03-19 12:54:29 +01:00
comfyanonymous
6b95166668 Fix annoyance. 2023-03-18 14:52:19 -04:00
pythongosssss
1f32af0210 Add dragdrop handling to nodes with upload widget 2023-03-14 21:13:29 +00:00
pythongosssss
9ee1eb8dc5 Changed to upload to input dir
Fixed jpg
Added dupe support
Changed to use existing nodes
2023-03-09 17:57:59 +00:00
pythongosssss
1fcec7070e Added UploadImage+Mask nodes 2023-03-08 22:07:44 +00:00
pythongosssss
a31483f566 Restored missing input edit fix 2023-03-03 20:10:18 +00:00
pythongosssss
dfe25a9eaa Adding built in extensions + example 2023-03-03 18:28:34 +00:00
pythongosssss
739fb214e0 Added handling of sockets
Started rework of UI elements
Added pnginfo handling
2023-03-02 21:34:29 +00:00
pythongosssss
f51b02e59f Initial refactoring changes
- Moved to web folder
 - Splitting into individual files
2023-03-02 20:00:06 +00:00