Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@

ComfyUI is the AI creation engine for visual professionals who demand control over every model, every parameter, and every output. Its powerful and modular node graph interface empowers creatives to generate images, videos, 3D models, audio, and more...
- ComfyUI natively supports the latest open-source state of the art models.
- API nodes provide access to the best closed source models such as Nano Banana, Seedance, Hunyuan3D, etc.
- [Partner nodes](https://docs.comfy.org/tutorials/partner-nodes/overview#partner-nodes) provide access to the best closed source models such as Nano Banana, Seedance, Hunyuan3D, etc.
- It is available on Windows, Linux, and macOS, locally with our [desktop application](https://www.comfy.org/download), our [portable install](#installing) or on our [cloud](https://www.comfy.org/cloud).
- The most sophisticated workflows can be exposed through a simple UI thanks to App Mode.
- It integrates seamlessly into production pipelines with our API endpoints.
Expand Down
7 changes: 6 additions & 1 deletion comfy/ldm/lightricks/vae/na_diffusion_decoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import torch.nn.functional as F
from einops import rearrange
from torch import nn
import comfy.model_management

from comfy.ldm.lightricks.model import get_timestep_embedding
from .causal_video_autoencoder import Encoder, processor
Expand Down Expand Up @@ -74,8 +75,12 @@ def default_rope_dim_split(head_dim):


def rope_inv_freqs(dim, base=10000.0, device=None):
out_device = device
if not comfy.model_management.supports_fp64(device):
device = torch.device("cpu")

exponents = torch.arange(0, dim, 2, dtype=torch.float64, device=device) / dim
return (1.0 / torch.pow(torch.tensor(float(base), dtype=torch.float64, device=device), exponents)).to(torch.float32)
return (1.0 / torch.pow(torch.tensor(float(base), dtype=torch.float64, device=device), exponents)).to(dtype=torch.float32, device=out_device)


def _rope_tables(lengths, inv_freqs, device):
Expand Down
2 changes: 1 addition & 1 deletion comfy_extras/nodes_preview_any.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def main(self, source=None):
value = str(source)
elif source is not None:
try:
value = json.dumps(source, indent=4)
value = json.dumps(source, indent=4, ensure_ascii=False)
except Exception:
try:
value = str(source)
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
comfyui-frontend-package==1.48.7
comfyui-workflow-templates==0.11.39
comfyui-workflow-templates==0.11.40
comfyui-embedded-docs==0.5.9
torch
torchsde
Expand Down
30 changes: 30 additions & 0 deletions tests-unit/comfy_extras_test/nodes_preview_any_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
from unittest.mock import patch, MagicMock

mock_nodes = MagicMock()
mock_nodes.MAX_RESOLUTION = 16384
mock_server = MagicMock()

with patch.dict("sys.modules", {"nodes": mock_nodes, "server": mock_server}):
from comfy_extras.nodes_preview_any import PreviewAny


class TestPreviewAnyMain:
@staticmethod
def _exec(source) -> dict:
return PreviewAny().main(source)

def test_dict_keeps_non_ascii(self):
result = self._exec({"greeting": "你好"})
assert "你好" in result["ui"]["text"][0]
assert "\\u" not in result["ui"]["text"][0]
assert result["result"][0] == result["ui"]["text"][0]

def test_list_keeps_non_ascii(self):
result = self._exec(["你好", "こんにちは"])
assert "こんにちは" in result["result"][0]
assert "\\u" not in result["result"][0]

def test_string_passthrough(self):
result = self._exec("你好")
assert result["ui"]["text"][0] == "你好"
assert result["result"][0] == "你好"
Loading