mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-04-18 22:42:35 +08:00
Merge upstream/master, keep local README.md
This commit is contained in:
commit
63aef61d6d
@ -53,6 +53,16 @@ try:
|
|||||||
repo.stash(ident)
|
repo.stash(ident)
|
||||||
except KeyError:
|
except KeyError:
|
||||||
print("nothing to stash") # noqa: T201
|
print("nothing to stash") # noqa: T201
|
||||||
|
except:
|
||||||
|
print("Could not stash, cleaning index and trying again.") # noqa: T201
|
||||||
|
repo.state_cleanup()
|
||||||
|
repo.index.read_tree(repo.head.peel().tree)
|
||||||
|
repo.index.write()
|
||||||
|
try:
|
||||||
|
repo.stash(ident)
|
||||||
|
except KeyError:
|
||||||
|
print("nothing to stash.") # noqa: T201
|
||||||
|
|
||||||
backup_branch_name = 'backup_branch_{}'.format(datetime.today().strftime('%Y-%m-%d_%H_%M_%S'))
|
backup_branch_name = 'backup_branch_{}'.format(datetime.today().strftime('%Y-%m-%d_%H_%M_%S'))
|
||||||
print("creating backup branch: {}".format(backup_branch_name)) # noqa: T201
|
print("creating backup branch: {}".format(backup_branch_name)) # noqa: T201
|
||||||
try:
|
try:
|
||||||
|
|||||||
@ -58,8 +58,13 @@ class InternalRoutes:
|
|||||||
return web.json_response({"error": "Invalid directory type"}, status=400)
|
return web.json_response({"error": "Invalid directory type"}, status=400)
|
||||||
|
|
||||||
directory = get_directory_by_type(directory_type)
|
directory = get_directory_by_type(directory_type)
|
||||||
|
|
||||||
|
def is_visible_file(entry: os.DirEntry) -> bool:
|
||||||
|
"""Filter out hidden files (e.g., .DS_Store on macOS)."""
|
||||||
|
return entry.is_file() and not entry.name.startswith('.')
|
||||||
|
|
||||||
sorted_files = sorted(
|
sorted_files = sorted(
|
||||||
(entry for entry in os.scandir(directory) if entry.is_file()),
|
(entry for entry in os.scandir(directory) if is_visible_file(entry)),
|
||||||
key=lambda entry: -entry.stat().st_mtime
|
key=lambda entry: -entry.stat().st_mtime
|
||||||
)
|
)
|
||||||
return web.json_response([entry.name for entry in sorted_files], status=200)
|
return web.json_response([entry.name for entry in sorted_files], status=200)
|
||||||
|
|||||||
@ -259,8 +259,10 @@ def detect_unet_config(state_dict, key_prefix, metadata=None):
|
|||||||
dit_config["nerf_tile_size"] = 512
|
dit_config["nerf_tile_size"] = 512
|
||||||
dit_config["nerf_final_head_type"] = "conv" if f"{key_prefix}nerf_final_layer_conv.norm.scale" in state_dict_keys else "linear"
|
dit_config["nerf_final_head_type"] = "conv" if f"{key_prefix}nerf_final_layer_conv.norm.scale" in state_dict_keys else "linear"
|
||||||
dit_config["nerf_embedder_dtype"] = torch.float32
|
dit_config["nerf_embedder_dtype"] = torch.float32
|
||||||
if "__x0__" in state_dict_keys: # x0 pred
|
if "__x0__" in state_dict_keys: # x0 pred
|
||||||
dit_config["use_x0"] = True
|
dit_config["use_x0"] = True
|
||||||
|
else:
|
||||||
|
dit_config["use_x0"] = False
|
||||||
else:
|
else:
|
||||||
dit_config["guidance_embed"] = "{}guidance_in.in_layer.weight".format(key_prefix) in state_dict_keys
|
dit_config["guidance_embed"] = "{}guidance_in.in_layer.weight".format(key_prefix) in state_dict_keys
|
||||||
dit_config["yak_mlp"] = '{}double_blocks.0.img_mlp.gate_proj.weight'.format(key_prefix) in state_dict_keys
|
dit_config["yak_mlp"] = '{}double_blocks.0.img_mlp.gate_proj.weight'.format(key_prefix) in state_dict_keys
|
||||||
|
|||||||
@ -549,8 +549,10 @@ class VAE:
|
|||||||
ddconfig = {"dim": dim, "z_dim": self.latent_channels, "dim_mult": [1, 2, 4, 4], "num_res_blocks": 2, "attn_scales": [], "temperal_downsample": [False, True, True], "dropout": 0.0}
|
ddconfig = {"dim": dim, "z_dim": self.latent_channels, "dim_mult": [1, 2, 4, 4], "num_res_blocks": 2, "attn_scales": [], "temperal_downsample": [False, True, True], "dropout": 0.0}
|
||||||
self.first_stage_model = comfy.ldm.wan.vae.WanVAE(**ddconfig)
|
self.first_stage_model = comfy.ldm.wan.vae.WanVAE(**ddconfig)
|
||||||
self.working_dtypes = [torch.bfloat16, torch.float16, torch.float32]
|
self.working_dtypes = [torch.bfloat16, torch.float16, torch.float32]
|
||||||
self.memory_used_encode = lambda shape, dtype: 6000 * shape[3] * shape[4] * model_management.dtype_size(dtype)
|
self.memory_used_encode = lambda shape, dtype: (1500 if shape[2]<=4 else 6000) * shape[3] * shape[4] * model_management.dtype_size(dtype)
|
||||||
self.memory_used_decode = lambda shape, dtype: 7000 * shape[3] * shape[4] * (8 * 8) * model_management.dtype_size(dtype)
|
self.memory_used_decode = lambda shape, dtype: (2200 if shape[2]<=4 else 7000) * shape[3] * shape[4] * (8*8) * model_management.dtype_size(dtype)
|
||||||
|
|
||||||
|
|
||||||
# Hunyuan 3d v2 2.0 & 2.1
|
# Hunyuan 3d v2 2.0 & 2.1
|
||||||
elif "geo_decoder.cross_attn_decoder.ln_1.bias" in sd:
|
elif "geo_decoder.cross_attn_decoder.ln_1.bias" in sd:
|
||||||
|
|
||||||
|
|||||||
@ -541,7 +541,7 @@ class SD3(supported_models_base.BASE):
|
|||||||
unet_extra_config = {}
|
unet_extra_config = {}
|
||||||
latent_format = latent_formats.SD3
|
latent_format = latent_formats.SD3
|
||||||
|
|
||||||
memory_usage_factor = 1.2
|
memory_usage_factor = 1.6
|
||||||
|
|
||||||
text_encoder_key_prefix = ["text_encoders."]
|
text_encoder_key_prefix = ["text_encoders."]
|
||||||
|
|
||||||
@ -965,7 +965,7 @@ class CosmosT2IPredict2(supported_models_base.BASE):
|
|||||||
|
|
||||||
def __init__(self, unet_config):
|
def __init__(self, unet_config):
|
||||||
super().__init__(unet_config)
|
super().__init__(unet_config)
|
||||||
self.memory_usage_factor = (unet_config.get("model_channels", 2048) / 2048) * 0.9
|
self.memory_usage_factor = (unet_config.get("model_channels", 2048) / 2048) * 0.95
|
||||||
|
|
||||||
def get_model(self, state_dict, prefix="", device=None):
|
def get_model(self, state_dict, prefix="", device=None):
|
||||||
out = model_base.CosmosPredict2(self, device=device)
|
out = model_base.CosmosPredict2(self, device=device)
|
||||||
@ -1026,7 +1026,7 @@ class ZImage(Lumina2):
|
|||||||
"shift": 3.0,
|
"shift": 3.0,
|
||||||
}
|
}
|
||||||
|
|
||||||
memory_usage_factor = 1.7
|
memory_usage_factor = 2.0
|
||||||
|
|
||||||
supported_inference_dtypes = [torch.bfloat16, torch.float16, torch.float32]
|
supported_inference_dtypes = [torch.bfloat16, torch.float16, torch.float32]
|
||||||
|
|
||||||
@ -1289,7 +1289,7 @@ class ChromaRadiance(Chroma):
|
|||||||
latent_format = comfy.latent_formats.ChromaRadiance
|
latent_format = comfy.latent_formats.ChromaRadiance
|
||||||
|
|
||||||
# Pixel-space model, no spatial compression for model input.
|
# Pixel-space model, no spatial compression for model input.
|
||||||
memory_usage_factor = 0.038
|
memory_usage_factor = 0.044
|
||||||
|
|
||||||
def get_model(self, state_dict, prefix="", device=None):
|
def get_model(self, state_dict, prefix="", device=None):
|
||||||
return model_base.ChromaRadiance(self, device=device)
|
return model_base.ChromaRadiance(self, device=device)
|
||||||
@ -1332,7 +1332,7 @@ class Omnigen2(supported_models_base.BASE):
|
|||||||
"shift": 2.6,
|
"shift": 2.6,
|
||||||
}
|
}
|
||||||
|
|
||||||
memory_usage_factor = 1.65 #TODO
|
memory_usage_factor = 1.95 #TODO
|
||||||
|
|
||||||
unet_extra_config = {}
|
unet_extra_config = {}
|
||||||
latent_format = latent_formats.Flux
|
latent_format = latent_formats.Flux
|
||||||
@ -1397,7 +1397,7 @@ class HunyuanImage21(HunyuanVideo):
|
|||||||
|
|
||||||
latent_format = latent_formats.HunyuanImage21
|
latent_format = latent_formats.HunyuanImage21
|
||||||
|
|
||||||
memory_usage_factor = 7.7
|
memory_usage_factor = 8.7
|
||||||
|
|
||||||
supported_inference_dtypes = [torch.bfloat16, torch.float32]
|
supported_inference_dtypes = [torch.bfloat16, torch.float32]
|
||||||
|
|
||||||
@ -1488,7 +1488,7 @@ class Kandinsky5(supported_models_base.BASE):
|
|||||||
unet_extra_config = {}
|
unet_extra_config = {}
|
||||||
latent_format = latent_formats.HunyuanVideo
|
latent_format = latent_formats.HunyuanVideo
|
||||||
|
|
||||||
memory_usage_factor = 1.1 #TODO
|
memory_usage_factor = 1.25 #TODO
|
||||||
|
|
||||||
supported_inference_dtypes = [torch.bfloat16, torch.float32]
|
supported_inference_dtypes = [torch.bfloat16, torch.float32]
|
||||||
|
|
||||||
@ -1517,7 +1517,7 @@ class Kandinsky5Image(Kandinsky5):
|
|||||||
}
|
}
|
||||||
|
|
||||||
latent_format = latent_formats.Flux
|
latent_format = latent_formats.Flux
|
||||||
memory_usage_factor = 1.1 #TODO
|
memory_usage_factor = 1.25 #TODO
|
||||||
|
|
||||||
def get_model(self, state_dict, prefix="", device=None):
|
def get_model(self, state_dict, prefix="", device=None):
|
||||||
out = model_base.Kandinsky5Image(self, device=device)
|
out = model_base.Kandinsky5Image(self, device=device)
|
||||||
|
|||||||
@ -2056,7 +2056,7 @@ class KlingExtension(ComfyExtension):
|
|||||||
OmniProImageToVideoNode,
|
OmniProImageToVideoNode,
|
||||||
OmniProVideoToVideoNode,
|
OmniProVideoToVideoNode,
|
||||||
OmniProEditVideoNode,
|
OmniProEditVideoNode,
|
||||||
# OmniProImageNode, # need support from backend
|
OmniProImageNode,
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user