Skip to content

Commit 2dc24f9

Browse files
committed
Merge branch 'master' into dr-support-pip-cm
2 parents 8634b19 + b1fa192 commit 2dc24f9

File tree

6 files changed

+579
-575
lines changed

6 files changed

+579
-575
lines changed

README.md

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -206,14 +206,32 @@ Put your SD checkpoints (the huge ckpt/safetensors files) in: models/checkpoints
206206
Put your VAE in: models/vae
207207

208208

209-
### AMD GPUs (Linux only)
209+
### AMD GPUs (Linux)
210+
210211
AMD users can install rocm and pytorch with pip if you don't have it already installed, this is the command to install the stable version:
211212

212213
```pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/rocm6.4```
213214

214-
This is the command to install the nightly with ROCm 6.4 which might have some performance improvements:
215+
This is the command to install the nightly with ROCm 7.0 which might have some performance improvements:
216+
217+
```pip install --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/rocm7.0```
218+
219+
220+
### AMD GPUs (Experimental: Windows and Linux), RDNA 3, 3.5 and 4 only.
221+
222+
These have less hardware support than the builds above but they work on windows. You also need to install the pytorch version specific to your hardware.
223+
224+
RDNA 3 (RX 7000 series):
225+
226+
```pip install --pre torch torchvision torchaudio --index-url https://rocm.nightlies.amd.com/v2/gfx110X-dgpu/```
215227

216-
```pip install --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/rocm6.4```
228+
RDNA 3.5 (Strix halo/Ryzen AI Max+ 365):
229+
230+
```pip install --pre torch torchvision torchaudio --index-url https://rocm.nightlies.amd.com/v2/gfx1151/```
231+
232+
RDNA 4 (RX 9000 series):
233+
234+
```pip install --pre torch torchvision torchaudio --index-url https://rocm.nightlies.amd.com/v2/gfx120X-all/```
217235

218236
### Intel GPUs (Windows and Linux)
219237

@@ -270,12 +288,6 @@ You can install ComfyUI in Apple Mac silicon (M1 or M2) with any recent macOS ve
270288

271289
> **Note**: Remember to add your models, VAE, LoRAs etc. to the corresponding Comfy folders, as discussed in [ComfyUI manual installation](#manual-install-windows-linux).
272290
273-
#### DirectML (AMD Cards on Windows)
274-
275-
This is very badly supported and is not recommended. There are some unofficial builds of pytorch ROCm on windows that exist that will give you a much better experience than this. This readme will be updated once official pytorch ROCm builds for windows come out.
276-
277-
```pip install torch-directml``` Then you can launch ComfyUI with: ```python main.py --directml```
278-
279291
#### Ascend NPUs
280292

281293
For models compatible with Ascend Extension for PyTorch (torch_npu). To get started, ensure your environment meets the prerequisites outlined on the [installation](https://ascend.github.io/docs/sources/ascend/quick_install.html) page. Here's a step-by-step guide tailored to your platform and installation method:

comfy_api_nodes/nodes_gemini.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
tensor_to_base64_string,
4040
bytesio_to_image_tensor,
4141
)
42+
from comfy_api.util import VideoContainer, VideoCodec
4243

4344

4445
GEMINI_BASE_ENDPOINT = "/proxy/vertexai/gemini"
@@ -310,7 +311,7 @@ def create_video_parts(self, video_input: IO.VIDEO, **kwargs) -> list[GeminiPart
310311
Returns:
311312
List of GeminiPart objects containing the encoded video.
312313
"""
313-
from comfy_api.util import VideoContainer, VideoCodec
314+
314315
base_64_string = video_to_base64_string(
315316
video_input,
316317
container_format=VideoContainer.MP4,

comfy_api_nodes/nodes_moonvalley.py

Lines changed: 2 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,7 @@
22
from typing import Any, Callable, Optional, TypeVar
33
import torch
44
from typing_extensions import override
5-
from comfy_api_nodes.util.validation_utils import (
6-
get_image_dimensions,
7-
validate_image_dimensions,
8-
)
9-
5+
from comfy_api_nodes.util.validation_utils import validate_image_dimensions
106

117
from comfy_api_nodes.apis import (
128
MoonvalleyTextToVideoRequest,
@@ -132,47 +128,6 @@ def validate_prompts(
132128
return True
133129

134130

135-
def validate_input_media(width, height, with_frame_conditioning, num_frames_in=None):
136-
# inference validation
137-
# T = num_frames
138-
# in all cases, the following must be true: T divisible by 16 and H,W by 8. in addition...
139-
# with image conditioning: H*W must be divisible by 8192
140-
# without image conditioning: T divisible by 32
141-
if num_frames_in and not num_frames_in % 16 == 0:
142-
return False, ("The input video total frame count must be divisible by 16!")
143-
144-
if height % 8 != 0 or width % 8 != 0:
145-
return False, (
146-
f"Height ({height}) and width ({width}) must be " "divisible by 8"
147-
)
148-
149-
if with_frame_conditioning:
150-
if (height * width) % 8192 != 0:
151-
return False, (
152-
f"Height * width ({height * width}) must be "
153-
"divisible by 8192 for frame conditioning"
154-
)
155-
else:
156-
if num_frames_in and not num_frames_in % 32 == 0:
157-
return False, ("The input video total frame count must be divisible by 32!")
158-
159-
160-
def validate_input_image(
161-
image: torch.Tensor, with_frame_conditioning: bool = False
162-
) -> None:
163-
"""
164-
Validates the input image adheres to the expectations of the API:
165-
- The image resolution should not be less than 300*300px
166-
- The aspect ratio of the image should be between 1:2.5 ~ 2.5:1
167-
168-
"""
169-
height, width = get_image_dimensions(image)
170-
validate_input_media(width, height, with_frame_conditioning)
171-
validate_image_dimensions(
172-
image, min_width=300, min_height=300, max_height=MAX_HEIGHT, max_width=MAX_WIDTH
173-
)
174-
175-
176131
def validate_video_to_video_input(video: VideoInput) -> VideoInput:
177132
"""
178133
Validates and processes video input for Moonvalley Video-to-Video generation.
@@ -499,7 +454,7 @@ async def execute(
499454
seed: int,
500455
steps: int,
501456
) -> comfy_io.NodeOutput:
502-
validate_input_image(image, True)
457+
validate_image_dimensions(image, min_width=300, min_height=300, max_height=MAX_HEIGHT, max_width=MAX_WIDTH)
503458
validate_prompts(prompt, negative_prompt, MOONVALLEY_MAREY_MAX_PROMPT_LENGTH)
504459
width_height = parse_width_height_from_res(resolution)
505460

0 commit comments

Comments
 (0)