Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[minor-fix] Update booster_cache.py to import utility #1036

Merged
merged 1 commit into from
Jul 24, 2024

Conversation

sirouk
Copy link
Contributor

@sirouk sirouk commented Jul 24, 2024

NameError: name 'is_oneflow_available' is not defined

model_type EPS
Using pytorch attention in VAE
Using pytorch attention in VAE
clip missing: ['clip_l.logit_scale', 'clip_l.transformer.text_projection.weight']
loaded straight to GPU
Requested to load SDXL
Loading 1 new model
Cache lookup: Key='2a7f8ef5-49f3-4eba-b608-ae7acbb2e7c6', Cached Model Type='<class 'comfy.model_base.SDXL'>'
Cache lookup: Key='1bc2cd79-33f5-45fe-9421-46d892f695f6', Cached Model Type='<class 'NoneType'>'
!!! Exception during processing !!!
Traceback (most recent call last):
  File "/app/ComfyUI/execution.py", line 151, in recursive_execute
    output_data, output_ui = get_output_data(obj, input_data_all)
  File "/app/ComfyUI/execution.py", line 81, in get_output_data
    return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)
  File "/app/ComfyUI/execution.py", line 74, in map_node_over_list
    results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
  File "/root/miniconda3/envs/venv_image/lib/python3.10/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
    return func(*args, **kwargs)
  File "/app/ComfyUI/custom_nodes/onediff_comfy_nodes/_nodes.py", line 253, in onediff_load_checkpoint
    vae = self.speedup(
  File "/root/miniconda3/envs/venv_image/lib/python3.10/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
    return func(*args, **kwargs)
  File "/app/ComfyUI/custom_nodes/onediff_comfy_nodes/_nodes.py", line 80, in speedup
    return (booster(model, *args, **kwargs),)
  File "/app/ComfyUI/custom_nodes/onediff_comfy_nodes/modules/booster_scheduler.py", line 61, in __call__
    return self.compile(model=model, ckpt_name=ckpt_name, **kwargs)
  File "/app/ComfyUI/custom_nodes/onediff_comfy_nodes/modules/booster_scheduler.py", line 24, in wrapper
    self.cache_service.put(cached_model_key, cached_model)
  File "/app/ComfyUI/custom_nodes/onediff_comfy_nodes/modules/booster_cache.py", line 71, in put
    cached_model = get_cached_model(model)
  File "/root/miniconda3/envs/venv_image/lib/python3.10/functools.py", line 889, in wrapper
    return dispatch(args[0].__class__)(*args, **kw)
  File "/app/ComfyUI/custom_nodes/onediff_comfy_nodes/modules/booster_cache.py", line 54, in _
    if is_oneflow_available() and not is_disable_oneflow_backend():
NameError: name 'is_oneflow_available' is not defined

@strint strint requested a review from ccssu July 24, 2024 06:39
@strint strint merged commit 017dc6d into siliconflow:main Jul 24, 2024
1 of 2 checks passed
@dk994023477
Copy link

2024-08-04 03:17:20,713- root:181- ERROR- Traceback (most recent call last):
File "/app/execution.py", line 152, in recursive_execute
output_data, output_ui = get_output_data(obj, input_data_all)
File "/app/execution.py", line 82, in get_output_data
return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)
File "/app/execution.py", line 75, in map_node_over_list
results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
File "/build/venv/lib/python3.10/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
return func(*args, **kwargs)
File "/app/custom_nodes/onediff_comfy_nodes/_nodes.py", line 253, in onediff_load_checkpoint
vae = self.speedup(
File "/build/venv/lib/python3.10/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
return func(*args, **kwargs)
File "/app/custom_nodes/onediff_comfy_nodes/_nodes.py", line 80, in speedup
return (booster(model, *args, **kwargs),)
File "/app/custom_nodes/onediff_comfy_nodes/modules/booster_scheduler.py", line 61, in call
return self.compile(model=model, ckpt_name=ckpt_name, **kwargs)
File "/app/custom_nodes/onediff_comfy_nodes/modules/booster_scheduler.py", line 24, in wrapper
self.cache_service.put(cached_model_key, cached_model)
File "/app/custom_nodes/onediff_comfy_nodes/modules/booster_cache.py", line 72, in put
cached_model = get_cached_model(model)
File "/usr/lib/python3.10/functools.py", line 889, in wrapper
return dispatch(args[0].class)(*args, **kw)
File "/app/custom_nodes/onediff_comfy_nodes/modules/booster_cache.py", line 55, in _
if is_oneflow_available() and not is_disable_oneflow_backend():
NameError: name 'is_disable_oneflow_backend' is not defined

@hashmap521
Copy link

how do i resolve it

@strint
Copy link
Collaborator

strint commented Aug 7, 2024

how do i resolve it

from onediff.utils.import_utils import is_oneflow_available

Please check onediff_comfy_nodes/modules/booster_cache.py#L8 to see if there is

from onediff.utils.import_utils import is_oneflow_available

If not, please update onediff to get the latest onediff_comfy_nodes

@hashmap521
Copy link

I encountered an issue in ComfyUI where there is an import statement in the file.

@hashmap521
Copy link

Error occurred when executing OneDiffCheckpointLoaderSimple:

name 'is_disable_oneflow_backend' is not defined

File "/home/qrcode/comfyui/ComfyUI/execution.py", line 152, in recursive_execute
output_data, output_ui = get_output_data(obj, input_data_all)
File "/home/qrcode/comfyui/ComfyUI/execution.py", line 82, in get_output_data
return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)
File "/home/qrcode/comfyui/ComfyUI/execution.py", line 75, in map_node_over_list
results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
File "/home/qrcode/comfyui/comfyui-env/lib/python3.10/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
return func(*args, **kwargs)
File "/home/qrcode/comfyui/ComfyUI/custom_nodes/onediff_comfy_nodes/_nodes.py", line 253, in onediff_load_checkpoint
vae = self.speedup(
File "/home/qrcode/comfyui/comfyui-env/lib/python3.10/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
return func(*args, **kwargs)
File "/home/qrcode/comfyui/ComfyUI/custom_nodes/onediff_comfy_nodes/_nodes.py", line 80, in speedup
return (booster(model, *args, **kwargs),)
File "/home/qrcode/comfyui/ComfyUI/custom_nodes/onediff_comfy_nodes/modules/booster_scheduler.py", line 61, in call
return self.compile(model=model, ckpt_name=ckpt_name, **kwargs)
File "/home/qrcode/comfyui/ComfyUI/custom_nodes/onediff_comfy_nodes/modules/booster_scheduler.py", line 24, in wrapper
self.cache_service.put(cached_model_key, cached_model)
File "/home/qrcode/comfyui/ComfyUI/custom_nodes/onediff_comfy_nodes/modules/booster_cache.py", line 72, in put
cached_model = get_cached_model(model)
File "/usr/lib/python3.10/functools.py", line 889, in wrapper
return dispatch(args[0].class)(*args, **kw)
File "/home/qrcode/comfyui/ComfyUI/custom_nodes/onediff_comfy_nodes/modules/booster_cache.py", line 55, in _
if is_oneflow_available() and not is_disable_oneflow_backend(): this is error message

from collections import OrderedDict
from functools import singledispatch

import torch
from comfy.model_patcher import ModelPatcher
from comfy.sd import VAE
from onediff.torch_utils.module_operations import get_sub_module
from onediff.utils.import_utils import is_oneflow_available this is code

@hashmap521
Copy link

图片

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants