user-configurable package version settings #554
Replies: 4 comments 5 replies
-
This seems like a good idea. |
Beta Was this translation helpful? Give feedback.
-
This is implemented. |
Beta Was this translation helpful? Give feedback.
-
I'd argue these should remap to |
Beta Was this translation helpful? Give feedback.
-
For Mac M chips users, maybe adding the following config to example file is helpful
|
Beta Was this translation helpful? Give feedback.
-
context and cause: alllllllll sorts of skill levels and programming familiarity seem to be evident in the 500+ extensions available through manager. setting aside making sense of all their naming conventions and programming style choices, one major gripe that has recently completely blocked me from being able to use Comfy at all is the package variants and versions included in everyone's
requirements.txt
files. my guess is, folks are just doing apip freeze
or some other mechanism that puts whatever version the author has installed into the requirements files.problem: each time we install a new extension, a package previously installed (and functioning!) can get overwritten with a newer or older version, or a variant could be installed in parallel (the biggest pain here is OpenCV/cv2). this often works fine when it's just version - most packages don't have a lot of standard features that changed recently, and usually keep deprecated methods around for years, and most of our extension developers are not using the latest and greatest stuff, meaning most versions handle most vanilla methods everyone is using. however, there are a few places where versioning and variation are important, e.g. torch/CUDA and OpenCV. and these ones are more tied to the system configuration/environment than other packages - i.e. the choice between CUDA 11 and 12 could depend upon the user's GPU setup, and thus dictate other choices such as torch version. in my case i'm using a Docker container cuz ain't no damn way i'm letting everyone's custom scripts run freely on my system nor am i reading everyone's code... in the scenario of using a container, i need to use the "headless" version of OpenCV, which doesn't work when another version is installed at the same time.
idea for discussion: script the Manager to ignore by default all version assertions in someone's requirements file - e.g.
numpy<1.24>=1.18
simply becomesnumpy
(rant: honestly, what is someone using that broke after 1.24??? and why not just update your code if numpy 1.26 really did get ahead of you?). the other part of this idea is user-customizable consolidation of package variants - e.g.opencv-contrib-python
andopencv-python
and others get re-mapped asopencv-python-headless
in my customized version.here's some scratching i did to get my head around the mess of packages across all the extensions i have (one of which updated something in a recent update, and all my Comfy stuff stopped working altogether):
the output of this is a reverse-indexed dict where the key is the package spec, and the value is a list of what extensions require it:
this way, i could just not re-install an extension i don't really care about, or suspect broke my environment, and use the keys above to construct the remap below...
the part that's not so special from here is, i manually started putting together a dict to hold all the stuff i found which i wanted to replace with my preferred choice. you'll see above i mentioned a regex approach to grabbing all the lib names and versions, simplifying... this won't work programmatically without some further thought, and i only have a minority of all extensions available, so i don't know what else is out there to bite me... at any rate, here's my replacement thru till when i got tired of it:
with these replacements,
pip install -U
will just get the latest package, and any variant of something i need a custom version for (e.g. opencv) will not get messed up (i guess until a new variant comes along i haven't seen before?). if we use regex to strip version numbers and various [option] identifiers and replace "_" with "-", then the user customization would really be around packages with variation, and allow for a user to specify "yo i gotta use CUDA 11.8 because reasons" and not get messed up by someone's requirements file.so, that's all i have for this dump of an idea, now of course the question is, what would this break, and is that better/worse than what the existing free-for-all already breaks?
Beta Was this translation helpful? Give feedback.
All reactions