mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-01-09 13:50:49 +08:00
- Improve node loading order. It now occurs "as late as possible". Configuration should be exposed as per the README. - Added methods to specify custom folders and models used in examples more robustly for custom nodes. - Downloading models can now be gracefully interrupted. - Progress notifications are now sent over the network for distributed ComfyUI operations. - Python objects have been moved around to prevent less transitive package importing issues.
32 lines
815 B
Python
32 lines
815 B
Python
import threading
|
|
|
|
_interrupt_processing_mutex = threading.RLock()
|
|
_interrupt_processing = False
|
|
|
|
|
|
class InterruptProcessingException(Exception):
|
|
pass
|
|
|
|
|
|
def interrupt_current_processing(value=True):
|
|
global _interrupt_processing
|
|
global _interrupt_processing_mutex
|
|
with _interrupt_processing_mutex:
|
|
_interrupt_processing = value
|
|
|
|
|
|
def processing_interrupted():
|
|
global _interrupt_processing
|
|
global _interrupt_processing_mutex
|
|
with _interrupt_processing_mutex:
|
|
return _interrupt_processing
|
|
|
|
|
|
def throw_exception_if_processing_interrupted():
|
|
global _interrupt_processing
|
|
global _interrupt_processing_mutex
|
|
with _interrupt_processing_mutex:
|
|
if _interrupt_processing:
|
|
_interrupt_processing = False
|
|
raise InterruptProcessingException()
|