Workaround for import failure in transformers with certain pytorch installs #66
* seems to affects pytorch compiled with DISTRIBUTED=0, eg. Windows ROCm * should probably be fixed in transformers somehow?
This commit is contained in:
+12
-2
@@ -4,7 +4,7 @@ from . import api as api, nodes, tile, region, nsfw, translation, krita
|
||||
|
||||
class ExternalToolingNodes(ComfyExtension):
|
||||
async def get_node_list(self) -> list[type[io.ComfyNode]]:
|
||||
return [
|
||||
node_list = [
|
||||
nodes.LoadImageCache,
|
||||
nodes.SaveImageCache,
|
||||
nodes.LoadImageBase64,
|
||||
@@ -22,7 +22,6 @@ class ExternalToolingNodes(ComfyExtension):
|
||||
region.DefineRegion,
|
||||
region.ListRegionMasks,
|
||||
region.AttentionMask,
|
||||
nsfw.NSFWFilter,
|
||||
translation.Translate,
|
||||
krita.KritaOutput,
|
||||
krita.KritaSendText,
|
||||
@@ -34,6 +33,17 @@ class ExternalToolingNodes(ComfyExtension):
|
||||
krita.KritaStyle,
|
||||
krita.KritaStyleAndPrompt,
|
||||
]
|
||||
try: # see #66
|
||||
import nsfw
|
||||
|
||||
node_list.append(nsfw.NSFWFilter)
|
||||
except (ImportError, ModuleNotFoundError):
|
||||
import traceback
|
||||
|
||||
print("[comfyui-tooling-nodes] WARNING: Could not import all nodes.")
|
||||
traceback.print_exc()
|
||||
|
||||
return node_list
|
||||
|
||||
|
||||
async def comfy_entrypoint():
|
||||
|
||||
Reference in New Issue
Block a user