107 Commits (e60e19b175f93f2c8fac037063de9f13259be9d4)

Author SHA1 Message Date
pythongosssss e60e19b175
Add support for simple tooltips (#3842)
* Add support for simple tooltips

* Fix overflow

* Add tooltips for nodes in the default workflow

* new line

* Prevent potential crash

* PR feedback

* Hide tooltip when clicking (e.g. combo widget)

* Refactor tooltips, add node level support

* Fix

* move

* Fix test (and undo last change)

* Fixed indent

* Fix dom widgets, dont show tooltip if not over canvas
6 months ago
Robin Huang 3e52e0364c
Add model downloading endpoint. (#4248)
* Add model downloading endpoint.

* Move client session init to async function.

* Break up large function.

* Send "download_progress" as websocket event.

* Fixed

* Fixed.

* Use async mock.

* Move server set up to right before run call.

* Validate that model subdirectory cannot contain relative paths.

* Add download_model test checking for invalid paths.

* Remove DS_Store.

* Consolidate DownloadStatus and DownloadModelResult

* Add progress_interval as an optional parameter.

* Use tuple type from annotations.

* Use pydantic.

* Update comment.

* Revert "Use pydantic."

This reverts commit 7461e8eb0073add315c65c6f5e361f0891bffc7d.

* Add new line.

* Add newline EOF.

* Validate model filename as well.

* Add comment to not reply on internal.

* Restrict downloading to safetensor files only.
6 months ago
bymyself 33e5203a2a
Don't cache index.html (#4211) 7 months ago
Thomas Ward c5a48b15bd
Make default hash lib configurable without code changes via CLI argument (#3947)
* cli_args: Add --duplicate-check-hash-function.

* server.py: compare_image_hash configurable hash function

Uses an argument added in cli_args to specify the type of hashing to default to for duplicate hash checking.  Uses an `eval()` to identify the specific hashlib class to utilize, but ultimately safely operates because we have specific options and only those options/choices in the arg parser.  So we don't have any unsafe input there.

* Add hasher() to node_helpers

* hashlib selection moved to node_helpers

* default-hashing-function instead of dupe checking hasher

This makes a default-hashing-function option instead of previous selected option.

* Use args.default_hashing_function

* Use safer handling for node_helpers.hasher()

Uses a safer handling method than `eval` to evaluate default hashing function.

* Stray parentheses are evil.

* Indentation fix.

Somehow when I hit save I didn't notice I missed a space to make indentation work proper.  Oops!
7 months ago
Chenlei Hu 99458e8aca
Add `FrontendManager` to manage non-default front-end impl (#3897)
* Add frontend manager

* Add tests

* nit

* Add unit test to github CI

* Fix path

* nit

* ignore

* Add logging

* Install test deps

* Remove 'stable' keyword support

* Update test

* Add web-root arg

* Rename web-root to front-end-root

* Add test on non-exist version number

* Use repo owner/name to replace hard coded provider list

* Inline cmd args

* nit

* Fix unit test
7 months ago
Chenlei Hu 83f70a88fb
Add __module__ to node info (#3936)
Use more explicit name 'python_module'

Parse abs ath

Move parse to nodes.py
8 months ago
comfyanonymous 2f03201690 Remove some empty lines. 8 months ago
shawnington 52aaee251f
Fix to #3465. Prevent, resaving of duplicate images if overwrite not specified (#3472)
* Fix to #3465. Prevent the, resaving of duplicate images if overwrite not specified

This is a fix to #3465 

Adds function compare_image_hash to do a sha256 hash comparison between an uploaded image and existing images with matching file names. 

This changes the behavior so that only images having the same filename that are actually different are saved to input, existing images are instead now opened instead of resaved with increment. 

Currently, exact duplicates with the same filename are resave saved with an incremented filename in the format:

<filename> (n).ext 

with the code: 

```
while os.path.exists(filepath): 
                        filename = f"{split[0]} ({i}){split[1]}"
                        filepath = os.path.join(full_output_folder, filename)
                        i += 1
```

This commit changes this to: 

```
while os.path.exists(filepath): 
                        if compare_image_hash(filepath, image):
                            image_is_duplicate = True
                            break
                        filename = f"{split[0]} ({i}){split[1]}"
                        filepath = os.path.join(full_output_folder, filename)
                        i += 1
```

a check for if image_is_duplicate = False is done before saving the file. 

Currently, if you load the same image of a cat named cat.jpg into the LoadImage node 3 times, you will get 3 new files in your input folder with incremented file names.

With this change, you will now only have the single copy of cat.jpg, that will be re-opened instead of re-saved. 

However if you load 3 different images of cats named cat.jpg, you will get the expected behavior of having:
cat.jpg
cat (1).jpg
cat (2).jpg

This saves space and clutter. After checking my own input folder, I have 800+ images that are duplicates that were resaved with incremented file names amounting to more than 5GB of duplicated data.

* fixed typo in expression
8 months ago
Chenlei Hu d7f0964266
Fix routes (#3790) 8 months ago
Chenlei Hu 97ae6ef460
Add api/ prefix to api endpoints (#3779) 8 months ago
Garrett Sutula bacce529fb
Add TLS Support (#3312)
* Add TLS Support

* Add to readme

* Add guidance for windows users on generating certificates

* Add guidance for windows users on generating certificates

* Fix typo
10 months ago
comfyanonymous 2a813c3b09 Switch some more prints to logging. 12 months ago
comfyanonymous 0ed72befe1 Change log levels.
Logging level now defaults to info. --verbose sets it to debug.
12 months ago
comfyanonymous dc6d4151a2 Not needed anymore. 12 months ago
僵尸浩 8d7910cee9
disable follow_symlinks in static serving for security reason (#2902) 1 year ago
comfyanonymous 079dbf9198 Remove useless code. 1 year ago
pythongosssss 235727fed7
Store user settings/data on the server and multi user support (#2160)
* wip per user data

* Rename, hide menu

* better error
rework default user

* store pretty

* Add userdata endpoints
Change nodetemplates to userdata

* add multi user message

* make normal arg

* Fix tests

* Ignore user dir

* user tests

* Changed to default to browser storage and add server-storage arg

* fix crash on empty templates

* fix settings added before load

* ignore parse errors
1 year ago
ramyma af94eb14e3 fix: `/free` handler function name 1 year ago
comfyanonymous 6d281b4ff4 Add a /free route to unload models or free all memory.
A POST request to /free with: {"unload_models":true}
will unload models from vram.

A POST request to /free with: {"free_memory":true}
will unload models and free all cached data from the last run workflow.
1 year ago
comfyanonymous 8e2c99e3cf Fix issue when websocket is deleted when data is being sent. 1 year ago
comfyanonymous 21063fa35b Lower compress level of png sent on websocket. 1 year ago
comfyanonymous 2dd5b4dd78 Only show last 200 elements in the UI history tab. 1 year ago
comfyanonymous a12cc05323 Add --max-upload-size argument, the default is 100MB. 1 year ago
Dr.Lt.Data 1f38de1fb3 If an error occurs while retrieving object_info, only the node that encountered the error should be handled as an exception, while the information for the other nodes should continue to be processed normally. 1 year ago
Sean Lynch 8321592408 Escape paths when passing them to globs
Try to prevent JS search from breaking on pathnames with square
brackets.
1 year ago
Michael Poutre cc2fa311dd
fix(server): Disable access logs 1 year ago
comfyanonymous 9261587d89 Small refactor. 1 year ago
comfyanonymous d6d1a8998f Properly check upload filename for directory transversal. 1 year ago
Chris 694c705f52 get class description 1 year ago
Chris adb9eb94b0 Send class description if any 1 year ago
Ridan Vandenbergh 2cd3980199 Remove forced lowercase on embeddings endpoint 2 years ago
Chris 18379dea36 check for text attr and save 2 years ago
Chris edcff9ab8a copy metadata into modified image 2 years ago
Dr.Lt.Data 0faee1186f
support on prompt event handler (#765)
Co-authored-by: Lt.Dr.Data <lt.dr.data@gmail.com>
2 years ago
ramyma 0b6cf7a558 Increase client_max_size to allow bigger request bodies 2 years ago
pythongosssss cdaf65ceb1 remove log 2 years ago
pythongosssss 9b1d5a587c Allow loading js extensions without copying to /web folder 2 years ago
pythongosssss 0bbd9dd4d9 add system info to stats endpoint 2 years ago
comfyanonymous ccb6b70de1 Move image encoding outside of sampling loop for better preview perf. 2 years ago
comfyanonymous 876dadca84 Highlight nodes with errors in red even when workflow works fine. 2 years ago
Dr.Lt.Data c9f5d5b2e1
optimize: support preview mode for mask editor. (#755)
* support preview mode for mask editor.
* use original file reference instead of loaded frontend blob

bugfix:
* prevent file open dialog when save to load image

* bugfix: cannot clear previous mask painted image's alpha

* bugfix

* bugfix

---------

Co-authored-by: Lt.Dr.Data <lt.dr.data@gmail.com>
2 years ago
comfyanonymous 6253ec4aef Fix server crashing because of terminated websocket connection. 2 years ago
comfyanonymous af91df85c2 Add a /history/{prompt_id} endpoint. 2 years ago
space-nuko b4f434ee66 Preview sampled images with TAESD 2 years ago
comfyanonymous 2ec980bb9f Limit preview to webp and RGB jpeg. 2 years ago
Dr.Lt.Data 9f3a19b728
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>
2 years ago
comfyanonymous 67892b5ac5 Refactor and improve model_management code related to free memory. 2 years ago
space-nuko b5dd15c67a System stats endpoint 2 years ago
space-nuko 1bbd3f7fe1 Send back prompt number from prompt/ endpoint 2 years ago
comfyanonymous b9818eb910 Add route to get safetensors metadata:
/view_metadata/loras?filename=lora.safetensors
2 years ago