Commit Graph

241 Commits

Author SHA1 Message Date
comfyanonymous
65e4ca7164 Don't import custom nodes when the folder ends with .disabled 2023-05-15 03:31:03 -04:00
comfyanonymous
140000f46e Make DiffusersLoader work with subfolders. 2023-05-15 03:25:24 -04:00
comfyanonymous
74695f4164 Remove useless code. 2023-05-14 12:50:21 -04:00
comfyanonymous
155842fc29 Return right type when none specified in upload route.
Switch time.time to time.perf_counter for custom node import times.
2023-05-13 15:31:22 -04:00
comfyanonymous
6946c2f925 Print if custom nodes imported successfully or not. 2023-05-13 13:23:42 -04:00
comfyanonymous
4dfd50fe6b Print all custom node import times. 2023-05-13 13:15:31 -04:00
comfyanonymous
ef3551846c Change message. 2023-05-13 13:05:52 -04:00
comfyanonymous
7be72f611d Load nodes in comfy_extras before custom nodes.
Change the slow import message.
2023-05-13 12:50:42 -04:00
comfyanonymous
7b5f90e688 Print custom nodes that take too much time to import. 2023-05-13 11:54:45 -04:00
BlenderNeko
dd1be4e992 Make nodes map over input lists (#579)
* allow nodes to map over lists

* make work with IS_CHANGED and VALIDATE_INPUTS

* give list outputs distinct socket shape

* add rebatch node

* add batch index logic

* add repeat latent batch

* deal with noise mask edge cases in latentfrombatch
2023-05-13 11:15:45 -04:00
comfyanonymous
8ab0a7e0fc noise_mask in latent should be in a single format. 2023-05-12 20:34:48 -04:00
comfyanonymous
4976875d17 Remove print. 2023-05-09 10:29:58 -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
comfyanonymous
57f35b3d16 maximum_batch_area for xformers.
Remove useless code.
2023-05-06 19:28:46 -04:00
comfyanonymous
ad56cfe814 Add a total_steps value to sampler callback. 2023-05-03 12:58:10 -04:00
comfyanonymous
df01203955 Use sampler callback instead of tqdm hook for progress bar. 2023-05-02 23:00:49 -04:00
comfyanonymous
71b4d08e65 Change latent resolution step to 8. 2023-05-02 14:17:51 -04:00
comfyanonymous
876322fd11 Expose grow_mask_by in VAEEncodeForInpaint.
The mask is dilated by grow_mask_by pixels after being applied to the pixel
space image. This helps reduce seams caused by inpainting. Higher value
means less seams.
2023-05-02 00:53:15 -04:00
comfyanonymous
9ad87ebc72 Fix ConditioningAverage. 2023-04-30 17:33:43 -04:00
FizzleDorf
0272debabc Conditioning Average (#495)
* first commit

* fixed a bunch of things missing in initial commit.

* parameters renamed for clarity

* renamed node, attempted update cond list

* to_strength removed, it is now normalized

* removed comments and prints. Attempted to apply to every cond in list again but no luck

* fixed repeating frames after batch using deepcopy

* Revert "fixed repeating frames after batch using deepcopy"

This reverts commit 1086d6a0e1.

* Rewrite addWeighted to use torch.mul iteratively.

---------

Co-authored-by: City <125218114+city96@users.noreply.github.com>
2023-04-30 17:33:15 -04:00
comfyanonymous
1b5e610811 Make ConditioningSetMask area option a bit more clear.
Make ConditioningSetArea override the set_area_to_bounds.
2023-04-29 20:25:05 -04:00
comfyanonymous
54d388428a Mask strength should be separate from area strength. 2023-04-29 20:06:53 -04:00
Jacob Segal
f7dd560777 Default to sampling entire image
By default, when applying a mask to a condition, the entire image will
still be used for sampling. The new "set_area_to_bounds" option on the
node will allow the user to automatically limit conditioning to the
bounds of the mask.

I've also removed the dependency on torchvision for calculating bounding
boxes. I've taken the opportunity to fix some frustrating details in the
other version:
1. An all-0 mask will no longer cause an error
2. Indices are returned as integers instead of floats so they can be
   used to index into tensors.
2023-04-29 00:16:58 -07:00
Jacob Segal
6bfd8b6b1a Add Condition by Mask node
This PR adds support for a Condition by Mask node. This node allows
conditioning to be limited to a non-rectangle area.
2023-04-27 20:03:27 -07:00
comfyanonymous
d95ef10342 Some fixes to the batch masks PR. 2023-04-25 01:12:40 -04:00
comfyanonymous
434fdea402 Merge branch 'multiple_inpaint_masks' of https://github.com/guill/ComfyUI
# Conflicts:
#	nodes.py
2023-04-25 00:54:15 -04:00
comfyanonymous
288c72fe9f Refactor more code to sample.py 2023-04-24 23:25:51 -04:00
comfyanonymous
3672f1eeca Merge branch 'master' of https://github.com/BlenderNeko/ComfyUI 2023-04-24 17:57:27 -04:00
BlenderNeko
7db702ecd0 made sample functions more explicit 2023-04-24 12:53:10 +02:00
comfyanonymous
04da98df66 Add a way for nodes to validate their own inputs. 2023-04-23 16:03:26 -04:00
ltdrdata
73ff5c5278 Add clipspace feature. (#541)
* 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.

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

* robust patch & refactoring folder_paths about annotated_filepath

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

* instant refresh on paste

force triggering 'changed' on paste action

* subfolder fix on paste logic

attach subfolder if subfolder isn't empty

---------

Co-authored-by: Lt.Dr.Data <lt.dr.data@gmail.com>
2023-04-23 15:58:55 -04:00
BlenderNeko
ac6686d523 add docstrings 2023-04-23 20:09:09 +02:00
BlenderNeko
1e9a5097e1 Merge branch 'master' of https://github.com/BlenderNeko/ComfyUI 2023-04-23 20:02:18 +02:00
BlenderNeko
3e6b963e46 refactor/split various bits of code for sampling 2023-04-23 20:02:08 +02:00
comfyanonymous
e6771d0986 Implement Linear hypernetworks.
Add a HypernetworkLoader node to use hypernetworks.
2023-04-23 12:35:25 -04:00
Jacob Segal
91bebda537 Add support for multiple unique inpainting masks
This enables workflows like "Inpaint at full resolution" when using
batch sizes greater than 1.
2023-04-22 16:02:26 -07:00
comfyanonymous
fca9adbee2 Add GLIGEN example to README. 2023-04-20 17:30:10 -04:00
comfyanonymous
6c156642e4 Add support for GLIGEN textbox model. 2023-04-19 11:06:32 -04:00
comfyanonymous
5a6311dd04 Fix bug. 2023-04-17 18:19:57 -04:00
comfyanonymous
b9d343ce70 Add a LatentFromBatch node to pick a single latent from a batch.
Works before and after sampling.
2023-04-17 17:28:07 -04:00
comfyanonymous
24c259ae9a custom_nodes paths can now be set in the extra_model_paths.yaml 2023-04-16 01:46:43 -04:00
comfyanonymous
4df70d0f62 Fix model_management import so it doesn't get executed twice. 2023-04-15 19:04:33 -04:00
comfyanonymous
3fe8074417 Refactor: move nodes_mask_convertion nodes to nodes_mask. 2023-04-14 00:21:01 -04:00
comfyanonymous
7f6c42d878 Merge branch 'image-to-mask' of https://github.com/missionfloyd/ComfyUI
# Conflicts:
#	nodes.py
2023-04-14 00:15:48 -04:00
comfyanonymous
c98d02a0cd Revert LatentComposite. 2023-04-14 00:14:35 -04:00
comfyanonymous
e91109f681 Merge branch 'master' of https://github.com/mligaintart/ComfyUI 2023-04-14 00:12:58 -04:00
Gavroche CryptoRUSH
e891b3e251 remove extra semi-colon 2023-04-13 16:38:02 -04:00
missionfloyd
cb25768a09 Move mask conversion to separate file 2023-04-13 03:11:17 -06:00
missionfloyd
253fedcb6b Merge branch 'comfyanonymous:master' into image-to-mask 2023-04-13 03:07:08 -06:00
comfyanonymous
138e6bf4c3 Merge branch 'fix-LoadImageMask' of https://github.com/flyingshutter/ComfyUI 2023-04-12 01:24:53 -04:00
missionfloyd
4598d8967a use slice instead of torch.select() 2023-04-11 20:26:24 -06:00
missionfloyd
9ec7729bea Image/mask conversion nodes 2023-04-11 16:49:39 -06:00
comfyanonymous
acfbb83783 Rename. 2023-04-08 15:53:01 -04:00
comfyanonymous
25edb68351 Merge branch 'master' of https://github.com/city96/ComfyUI 2023-04-08 15:50:26 -04:00
comfyanonymous
88e5ccb415 Cleanup. 2023-04-07 02:31:46 -04:00
comfyanonymous
d4301d49d3 Fix loading SD1.5 diffusers checkpoint. 2023-04-07 01:30:33 -04:00
sALTaccount
9247130f31 fix loading alt folders 2023-04-06 22:02:26 -07:00
sALTaccount
8b7d1f0a4b search all diffusers paths (oops) 2023-04-06 21:48:58 -07:00
sALTaccount
0a388f2a23 allow configurable path for diffusers models 2023-04-06 21:45:08 -07:00
mligaintart
c80d164c5b Adds masking to Latent Composite, and provides new masking utilities to
allow better compositing.
2023-04-06 15:18:20 -04:00
flyingshutter
fb486c15c3 make LoadImagesMask work with non RGBA images 2023-04-06 19:02:28 +02:00
sALTaccount
7bd683c9f5 use precision determined by model management 2023-04-06 00:28:06 -07:00
sALTaccount
3badb30fb9 empty list if diffusers directory doesn't exist 2023-04-06 00:24:52 -07:00
sALTaccount
671feba9e6 diffusers loader 2023-04-05 23:57:31 -07:00
comfyanonymous
4ee5acc3a7 Add a way to set output directory with --output-directory 2023-04-05 14:29:30 -04:00
comfyanonymous
6706afcd0a Move unclip stuff out of _for_testing 2023-04-04 22:48:11 -04:00
comfyanonymous
18caacecea Merge branch 'nodes-post-processing' of https://github.com/EllangoK/ComfyUI 2023-04-04 13:51:26 -04:00
comfyanonymous
0e06be56ad Add noise augmentation setting to unCLIPConditioning. 2023-04-03 13:50:29 -04:00
EllangoK
f9f6352506 adds Blend, Blur, Dither, Sharpen nodes 2023-04-02 18:44:27 -04:00
comfyanonymous
bbd3cb4c22 Merge branch 'custom_routes' of https://github.com/pythongosssss/ComfyUI 2023-04-02 01:55:05 -04:00
comfyanonymous
b55667284c Add support for unCLIP SD2.x models.
See _for_testing/unclip in the UI for the new nodes.

unCLIPCheckpointLoader is used to load them.

unCLIPConditioning is used to add the image cond and takes as input a
CLIPVisionEncode output which has been moved to the conditioning section.
2023-04-01 23:19:15 -04:00
pythongosssss
5048e1e484 Merge remote-tracking branch 'origin/master' into custom_routes 2023-04-01 12:44:40 +01:00
pythongosssss
86f7d35883 Tweak server/custom node load order
- Load custom nodes after creating server
 - Add routes after loading custom nodes
Custom nodes can now add routes via PromptServer.instance
2023-04-01 12:44:29 +01:00
comfyanonymous
7da8d5f9f5 Add a TomePatchModel node to the _for_testing section.
Tome increases sampling speed at the expense of quality.
2023-03-31 17:19:58 -04:00
City
e3d748d912 Add human-readable name support for custom nodes 2023-03-31 07:05:17 +02:00
City
dd438a9d3b Add human-readable names for nodes 2023-03-30 23:13:58 +02:00
Silversith
ec0201e32a Bugfix/include optional node inputs (#271)
* Minor changes and extra nodes

* Added Preview Image for Nodes

* Add a delete images button on main floating menu

* Add a confirmation dialog

* Remove DeleteAll, Remove Custom KSampler, Remove Image List

* Remove Image and Custom Json Load

* Remove Custom Nodes

* remove patch.diff
2023-03-27 01:16:22 -04:00
comfyanonymous
200431f6ef Style. 2023-03-26 15:17:53 -04:00
m957ymj75urz
dfd2379df7 compute %width% and %height% in filepath when saving 2023-03-26 13:10:20 +02:00
comfyanonymous
71e7d96dcc Allow negative Lora strengths. 2023-03-25 21:31:39 -04:00
comfyanonymous
578af3b348 Merge branch 'allow-symbolic-link' of https://github.com/jn-jairo/ComfyUI 2023-03-25 17:30:22 -04:00
comfyanonymous
8c565a2344 Set default value of feathering to 40. 2023-03-25 04:49:58 -04:00
Guo Y.K
3d1d82571f nodes: ImagePadForOutpaint: clean imports 2023-03-25 16:32:48 +08:00
Guo Y.K
bd10592890 nodes: ImagePadForOutpaint: fix feathering, ignore edges not expanded 2023-03-25 16:27:47 +08:00
Guo Y.K
2a62c41ba5 nodes: add feathering to to ImagePadForOutpaint 2023-03-24 22:39:33 +08:00
Jairo Correa
875e280bb3 Allow output folder to be a symbolic link 2023-03-23 21:25:21 -03:00
Guo Y.K
51536ab543 nodes: add ImagePadForOutpaint 2023-03-23 23:33:35 +08:00
comfyanonymous
70d7791299 Lower PNG compression for more speed.
After some quick tests compress_level=4 seems to give the best compression
performance ratio for stable diffusion images.

It's 10x faster than max compression for an image size increase of only
2.5%.
2023-03-23 00:40:48 -04:00
comfyanonymous
22bbcbc73c Increase max res to 8192x8192 since 4096x4096 wasn't enough for some. 2023-03-22 12:22:48 -04:00
comfyanonymous
186e1324bd Fix bug with CLIPLoader. 2023-03-21 03:11:18 -04:00
comfyanonymous
757a39cdd9 Small fix. 2023-03-20 14:55:28 -04: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
06c7a9b406 Support multiple paths for embeddings. 2023-03-18 03:08:43 -04:00
comfyanonymous
d5bf8038c8 Merge T2IAdapterLoader and ControlNetLoader.
Workflows will be auto updated.
2023-03-17 18:17:59 -04:00
comfyanonymous
ee6cca1d0f Add folder_paths so models can be in multiple paths. 2023-03-17 18:01:11 -04:00
comfyanonymous
c34d4e939d Fix VAEEncodeForInpaint modifying source image. 2023-03-16 17:10:08 -04:00
m957ymj75urz
d0a98fc078 fixes for specific paths 2023-03-16 19:48:59 +01:00
comfyanonymous
46d01dd049 Fix bug when applying controlnet to negative prompt. 2023-03-15 17:58:13 -04:00