mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2025-12-19 19:13:02 +08:00
Merge branch 'master' into dr-support-pip-cm
This commit is contained in:
commit
f398256d11
@ -66,6 +66,9 @@ See what ComfyUI can do with the [example workflows](https://comfyanonymous.gith
|
|||||||
- [Lumina Image 2.0](https://comfyanonymous.github.io/ComfyUI_examples/lumina2/)
|
- [Lumina Image 2.0](https://comfyanonymous.github.io/ComfyUI_examples/lumina2/)
|
||||||
- [HiDream](https://comfyanonymous.github.io/ComfyUI_examples/hidream/)
|
- [HiDream](https://comfyanonymous.github.io/ComfyUI_examples/hidream/)
|
||||||
- [Cosmos Predict2](https://comfyanonymous.github.io/ComfyUI_examples/cosmos_predict2/)
|
- [Cosmos Predict2](https://comfyanonymous.github.io/ComfyUI_examples/cosmos_predict2/)
|
||||||
|
- Image Editing Models
|
||||||
|
- [Omnigen 2](https://comfyanonymous.github.io/ComfyUI_examples/omnigen/)
|
||||||
|
- [Flux Kontext](https://comfyanonymous.github.io/ComfyUI_examples/flux/#flux-kontext-image-editing-model)
|
||||||
- Video Models
|
- Video Models
|
||||||
- [Stable Video Diffusion](https://comfyanonymous.github.io/ComfyUI_examples/video/)
|
- [Stable Video Diffusion](https://comfyanonymous.github.io/ComfyUI_examples/video/)
|
||||||
- [Mochi](https://comfyanonymous.github.io/ComfyUI_examples/mochi/)
|
- [Mochi](https://comfyanonymous.github.io/ComfyUI_examples/mochi/)
|
||||||
|
|||||||
@ -11,7 +11,7 @@ from comfy.ldm.modules.ema import LitEma
|
|||||||
import comfy.ops
|
import comfy.ops
|
||||||
|
|
||||||
class DiagonalGaussianRegularizer(torch.nn.Module):
|
class DiagonalGaussianRegularizer(torch.nn.Module):
|
||||||
def __init__(self, sample: bool = True):
|
def __init__(self, sample: bool = False):
|
||||||
super().__init__()
|
super().__init__()
|
||||||
self.sample = sample
|
self.sample = sample
|
||||||
|
|
||||||
@ -19,16 +19,12 @@ class DiagonalGaussianRegularizer(torch.nn.Module):
|
|||||||
yield from ()
|
yield from ()
|
||||||
|
|
||||||
def forward(self, z: torch.Tensor) -> Tuple[torch.Tensor, dict]:
|
def forward(self, z: torch.Tensor) -> Tuple[torch.Tensor, dict]:
|
||||||
log = dict()
|
|
||||||
posterior = DiagonalGaussianDistribution(z)
|
posterior = DiagonalGaussianDistribution(z)
|
||||||
if self.sample:
|
if self.sample:
|
||||||
z = posterior.sample()
|
z = posterior.sample()
|
||||||
else:
|
else:
|
||||||
z = posterior.mode()
|
z = posterior.mode()
|
||||||
kl_loss = posterior.kl()
|
return z, None
|
||||||
kl_loss = torch.sum(kl_loss) / kl_loss.shape[0]
|
|
||||||
log["kl_loss"] = kl_loss
|
|
||||||
return z, log
|
|
||||||
|
|
||||||
|
|
||||||
class AbstractAutoencoder(torch.nn.Module):
|
class AbstractAutoencoder(torch.nn.Module):
|
||||||
|
|||||||
@ -816,7 +816,7 @@ class PixArt(BaseModel):
|
|||||||
class Flux(BaseModel):
|
class Flux(BaseModel):
|
||||||
def __init__(self, model_config, model_type=ModelType.FLUX, device=None, unet_model=comfy.ldm.flux.model.Flux):
|
def __init__(self, model_config, model_type=ModelType.FLUX, device=None, unet_model=comfy.ldm.flux.model.Flux):
|
||||||
super().__init__(model_config, model_type, device=device, unet_model=unet_model)
|
super().__init__(model_config, model_type, device=device, unet_model=unet_model)
|
||||||
self.memory_usage_factor_conds = ("kontext",)
|
self.memory_usage_factor_conds = ("ref_latents",)
|
||||||
|
|
||||||
def concat_cond(self, **kwargs):
|
def concat_cond(self, **kwargs):
|
||||||
try:
|
try:
|
||||||
|
|||||||
@ -1,3 +1,3 @@
|
|||||||
# This file is automatically generated by the build process when version is
|
# This file is automatically generated by the build process when version is
|
||||||
# updated in pyproject.toml.
|
# updated in pyproject.toml.
|
||||||
__version__ = "0.3.42"
|
__version__ = "0.3.43"
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
[project]
|
[project]
|
||||||
name = "ComfyUI"
|
name = "ComfyUI"
|
||||||
version = "0.3.42"
|
version = "0.3.43"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
license = { file = "LICENSE" }
|
license = { file = "LICENSE" }
|
||||||
requires-python = ">=3.9"
|
requires-python = ">=3.9"
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user