mirror of
https://git.datalinker.icu/kijai/ComfyUI-KJNodes.git
synced 2025-12-09 21:04:41 +08:00
revert this
This commit is contained in:
parent
31639b4c79
commit
67c54b31e8
@ -2321,31 +2321,6 @@ def patched_load_lora_for_models(model, clip, lora, strength_model, strength_cli
|
|||||||
model.add_object_patch(k, compiled_block)
|
model.add_object_patch(k, compiled_block)
|
||||||
return (new_modelpatcher, new_clip)
|
return (new_modelpatcher, new_clip)
|
||||||
|
|
||||||
def patched_write_atomic(
|
|
||||||
path_: str,
|
|
||||||
content: Union[str, bytes],
|
|
||||||
make_dirs: bool = False,
|
|
||||||
encode_utf_8: bool = False,
|
|
||||||
) -> None:
|
|
||||||
# Write into temporary file first to avoid conflicts between threads
|
|
||||||
# Avoid using a named temporary file, as those have restricted permissions
|
|
||||||
from pathlib import Path
|
|
||||||
import os
|
|
||||||
import shutil
|
|
||||||
import threading
|
|
||||||
assert isinstance(
|
|
||||||
content, (str, bytes)
|
|
||||||
), "Only strings and byte arrays can be saved in the cache"
|
|
||||||
path = Path(path_)
|
|
||||||
if make_dirs:
|
|
||||||
path.parent.mkdir(parents=True, exist_ok=True)
|
|
||||||
tmp_path = path.parent / f".{os.getpid()}.{threading.get_ident()}.tmp"
|
|
||||||
write_mode = "w" if isinstance(content, str) else "wb"
|
|
||||||
with tmp_path.open(write_mode, encoding="utf-8" if encode_utf_8 else None) as f:
|
|
||||||
f.write(content)
|
|
||||||
shutil.copy2(src=tmp_path, dst=path) #changed to allow overwriting cache files
|
|
||||||
os.remove(tmp_path)
|
|
||||||
|
|
||||||
class PatchModelPatcherOrder:
|
class PatchModelPatcherOrder:
|
||||||
@classmethod
|
@classmethod
|
||||||
def INPUT_TYPES(s):
|
def INPUT_TYPES(s):
|
||||||
@ -2403,13 +2378,6 @@ class TorchCompileModelFluxAdvanced:
|
|||||||
return blocks
|
return blocks
|
||||||
|
|
||||||
def patch(self, model, backend, mode, fullgraph, single_blocks, double_blocks, dynamic):
|
def patch(self, model, backend, mode, fullgraph, single_blocks, double_blocks, dynamic):
|
||||||
if platform.system() == 'Windows':
|
|
||||||
try:
|
|
||||||
import torch._inductor.codecache
|
|
||||||
torch._inductor.codecache.write_atomic = patched_write_atomic #temporary workaround for the cache write bug in Windows
|
|
||||||
import torch
|
|
||||||
except:
|
|
||||||
pass
|
|
||||||
single_block_list = self.parse_blocks(single_blocks)
|
single_block_list = self.parse_blocks(single_blocks)
|
||||||
double_block_list = self.parse_blocks(double_blocks)
|
double_block_list = self.parse_blocks(double_blocks)
|
||||||
m = model.clone()
|
m = model.clone()
|
||||||
|
|||||||
@ -47,7 +47,9 @@ app.registerExtension({
|
|||||||
)
|
)
|
||||||
if (pythongossFeed) {
|
if (pythongossFeed) {
|
||||||
console.warn("KJNodes - Overriding pysssss.FaviconStatus")
|
console.warn("KJNodes - Overriding pysssss.FaviconStatus")
|
||||||
app.extensions = app.extensions.filter(item => item !== pythongossFeed);
|
pythongossFeed.setup = function() {
|
||||||
|
console.warn("Disabled by KJNodes")
|
||||||
|
};
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
Loading…
x
Reference in New Issue
Block a user