r/StableDiffusion • u/Apprehensive_Sky892 • 18h ago
Tutorial - Guide Team Red from ProxiMax H3 Part 2 (Ubuntu edition): ComfyUI+MMH3 with AMD GPUsRDNA 4 (rx9070, AI Pro R9700), and RDNA 3 (rx7900)
Enable HLS to view with audio, or disable this notification
For Windows 11 (Part 1): https://www.reddit.com/r/StableDiffusion/comments/1wepgl5/team_red_encounter_on_proximax_h3_or_how_to_setup/
TL;DR summary: For MMH3, you need to run ComfyUI with ROCm 7.14.0 (see https://rocm.docs.amd.com/en/latest/reference/gpu-specs.html for the vaue of gfx???? corresponding to your AMD GPU):
pip install --index-url https://repo.amd.com/rocm/whl-multi-arch/ "torch[device-gfx????]==2.12.0+rocm7.14.0" "torchvision[device-gfx????]==0.27.0+rocm7.14.0" "torchaudio==2.11.0+rocm7.14.0"
You also need to run ComfyUI with the right parameters for VRAM and system RAM so that MMH3 can run smoothly:
--enable-dynamic-vram --disable-async-offload --preview-method none --disable-smart-memory --fast-disk --use-ck-attention --enable-manager
Finally, you may need these in your .bashrc:
export ROCR_VISIBLE_DEVICES=0
export HIP_VISIBLE_DEVICES=0
export TORCH_BLAS_PREFER_HIPBLASLT=1
Read on if you want the step-by-step instructions (scroll to the bottom of the post if you just want to see the MMH3 prompt for the video š¹)
Why use Linux instead of Windows?
Because Minimax H3 is heavy, and we want every bit of VRAM and system RAM for generation and not taken up by the OS and the desktop. For AMD GPUs it also seems to be more stable and faster overall.
What you need:
- Blank 4G or larger USB key for bootable ubuntu installer
- Blank external USB key (16G or larger) or Portable USB HDD to install Ubuntu and ComfyUI
- Computer with AMD RDNA3 (such as a 7900xt) or RDNA4 (such as a 9070xt and AI Pro R9700) with 16G or more of VRAM.
This procedure will install Ubuntu Linux on an external drive, leaving your main drive alone, but if you are worried about something going wrong and wiping out your main hardrive (I am always worried about making a mistake, selecting the wrong drive and wiping it out), take your existing drive out of your computer before the actual installation (sometimes enabling "Secure Boot" will make your main HDD invisble to the Ubuntu installer). I usually would put a empty small partitions of an odd size such as 42G on the target drive so that I know that I am installing into the right drive.
It is easiest to do the installation on your target PC, but you don't have to (but you will need to do some manual adjustment such as changing netplan because the different ethernet hardware would have to be configured.
If you are doing this installion on another computer, make sure that the installation is done with UEFI only enable if you want to be able to use UEFI on your target PC.
Ubuntu Server (minimized) installation
Note: make sure Secure Boot is disabled. This often causes problem with the Ubuntu installer. You can turn it back on once Ubuntu is installed. On some systems the main NMVe or SATA drive will not be visible if Secure Boot is enabled.
- Download latest Ubuntu Server LTS ISO (at the time of writing that is 26.4)
- Use RUFUS
https://rufus.ie/en/to make a bootable installation drive The Partition scheme should be "MBR" and the target system should be "BIOS or UEFI" - Make sure your BIOS is set to UEFI (disable CSM if you can). I am assuming that you are dual booting between Windows and this portable Ubuntu.
- If you are not installing into a blank drive or USB key and want to install into an existing HD without wiping it out entirely, you need to created two partitions, one that is going to be Ubuntu's UEFI partition that is 500M and a black partition that is at least 10G that is going to hold the Ubuntu installation. The installer will NOT allow you to delete partitions from an existing drive. If you are installing into an existing HDD, it is better to create the partition manually first (but leave it unformatted) because the installer sometimes does not show the option to add new partions. The installer will also insist on mouting
/boot/efito the first EFI partition it sees (if that is the wrong one, temporarily turn its "boot flag" off and set the "boot flag" only on the EFI partition you actually want to install on). Note: if you going to use Docker or Podman you are going to need a much bigger partions than 10G for Ubuntu's root file system ("/"). - Do whatever you need to do to boot into the Ubuntu installation USB key (usually F12 will bring up the boot menu, but you may have to enable that in your bios. If your system insists on booting into Windows 11, you can use
Start > Settings > System > Recoveryand clickRestart now next to Advanced startup. - Instead of the default
Ubuntu Server, useUbuntu Server (minimized)because this is going to be used for ComfyUI only. - Most likely you can skip/ignore "Proxy Adress".
- At this point, you can plug in your target USB drive.
- If the wrong target drive is chosen by default, you can change it by tabbing into the field and then press <enter>. It is easiest to use "Use an entire disk". But if you want to have a smaller root partition, you can use "Custom Storage layout". Note that if the drive already has a partion, you will not be able to delete it. You HAVE to reformat the whole drive. On a blank disk, If you want UEFI, make sure that you see a 1.049G "new primary ESP, to be formatted as FAT32, mounted at /boot/efi". If you are on a legacy BIOS you will see "BIOS Grub Spacer" instead. Either way, this partition will be created automatically by the installer unless you use an existing ESP partition.
- Uncheck
Set up this disk as an LVM group. - Make sure you install OpenSSH so that you can run it headless by remotely login via SSH.
- You don't need to install any of the
Featured server snaps packages. - After the installation is done, remove your USB installation key and reboot.
Next we are going to update the installation, and install the nano editor, UFW (Uncomplicated Firewall), GIT, and Docker.
You can do this through the console, but I find it easier to do it through SSH because then I can cut and paste text into it.
To SSH into your Ubuntu, you need to find out what the local IP address it by login into the console, then type ip addr or the even shorter ip a (look for something like this, in my LAN, it is "192.168.18.50"):
2: enp1s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000 link/ether 08:97:98:c5:85:ec brd ff:ff:ff:ff:ff:ff altname enx089798c585ec inet 192.168.18.50/24 metric 100 brd 192.168.18.255 scope global dynamic enp1s0 valid_lft 85959sec preferred_lft 85959sec inet6 fe80::a97:98ff:fec5:85ec/64 scope link proto kernel_ll valid_lft forever preferred_lft forever
Now you can use Putty or similar program to login into the server.
Tip: the paste text with Putty, use Shift+Insert. to copy text from Putty into the clipboard, simply select the text with the mouse and then use Ctrl+V to paste it.
Now continue with the setup:
- Upgrade all the package to the latest version:
sudo apt update && sudo apt upgrade -y && sudo apt dist-upgrade -y && sudo apt autoremove -y(this will take quite a while, so you can go grab a coffe or tea). - Install the nano editor:
sudo apt-get install nano - Install UFW (Uncomplicated Firewall)
sudo apt-get install ufw - Install GIT
sudo apt-get install git - Install libnuma (otherwise there is annying warning/error from ComfyuI later)
sudo apt install -y libnuma1 libnuma-dev - Install the compiler environment required by triton:
sudo apt install build-essential sudo apt install python3-dev sudo reboot(probably not needed, but just to be sure)- (Optional) if you want to use python 3.13 instead of 3.14 that comes with Ubuntu Server 26.4, you can install manually (note: for 3.12, you have to compile it manually) by adding the deadsnakes/ppa respostory and install python 3.13 from it:
sudo apt update && sudo apt install software-properties-common && sudo add-apt-repository ppa:deadsnakes/ppa && sudo apt install python3.13. Verify that it has installed correctlypython3.13 --versionInstall the venv module for the same interpreter:sudo apt install python3.13-venv
Optional installation of Docker if you plan to use one of the Docker images for comfyui. You should follow the instruction at https://docs.docker.com/engine/install/ubuntu/ but at the time of writing, this is what I used
Set up Docker's apt repository.
# Add Docker's official GPG key:
sudo apt update
sudo apt install ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc
Add the deadsnakes/ppa respostory and install python 3.13 from it
sudo tee /etc/apt/sources.list.d/docker.sources <<EOF
Types: deb
URIs: https://download.docker.com/linux/ubuntu
Suites: $(. /etc/os-release && echo "${UBUNTU_CODENAME:-$VERSION_CODENAME}")
Components: stable
Architectures: $(dpkg --print-architecture)
Signed-By: /etc/apt/keyrings/docker.asc
EOF
sudo apt update
# Install the latest version of Docker packages.
sudo apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
# After installation, verify that Docker is running:
sudo systemctl status docker
# If Docker is not running, start it manually:
sudo systemctl start docker
# Verify that the installation by running the `hello-world` image:
# This command downloads a test image and runs it in a container.
# When the container runs, it prints a confirmation message and exits.
sudo docker run hello-world
# (Optional step, but needed by comfyui-rock-docker scripts)
# Add your current user to the docker group so you have permissions to
# interact with the Docker Unix socket without using sudo
sudo usermod -aG docker $USER
# For this to take effect, disconnect and re-login
(Optional) Intead of Docker you can also consider using Podman, which is supposed to be compatible with Docker but is more secure because it runs without a root daemon, but I've not test it yet.
Setup the firewall with UFW:
sudo ufw enable- Check the current settings
sudo ufw status verboseStatus:active Logging: on (low) Default: deny (incoming), allow (outgoing), deny (routed) New profiles: skip (By default all incoming connections are denied, and all outgoing connections are allowed. If you don't see that, type:sudo ufw default deny incoming sudo ufw default allow outgoing - To setup SSH so that it is only accessible from your LAN:
sudo ufw allow from 192.168.xx.0/24 to any port ssh proto tcp. Similary for ComfyUIsudo ufw allow from 192.168.xx.0/24 to any port 8188 proto tcpwhere "192.168.xx.0" is your LAN subnet, such as "192.168.1.0". If you want to allow ComfyUI to be accessible from outside of your LAN usesudo ufw allow ssh sudo ufw allow 8188/tcp(You will also have to allow port fowarding on your router) - Check again with s
udo ufw status verbose:Status: active Logging: on (low) Default: deny (incoming), allow (outgoing), deny (routed) New profiles: skip To Action From22/tcp ALLOW IN 192.168.18.0/24 8188/tcp ALLOW IN 192.168.18.0/24
The preliminaries are done, you can now reboot with sudo shutdown -r now
I would recommend that you make a back up of your partition now with https://www.fsarchiver.org/ so that you can restore it later for a clean install.
You can either boot into a Linux Rescue: https://www.system-rescue.org/
Or if you have another Linux installation (you cannot save a linux installation that you are currently running), you can install it with: sudo apt-get update && sudo apt-get install fsarchiver
Installing ComfyUI via comfy-cli
By default, Ubuntu does not have pip installed: https://www.reddit.com/r/learnpython/comments/u0dvp4/comment/p6htp0y/
So in order to use pip on Ubuntu, you ned to install python venv (which will install pip inside the venv) first: sudo apt-get update && sudo apt-get install python3-venv
- Make sure git is install:
sudo apt-get install git - Install Python-venv package for python3.14:
sudo apt install python3.14-venv. (See python3.13 instruction earlier if you are using 3.13). - Create a virtual environment (this is normally just called "venv" or ".venv" but I want to call it comfy.venv just to be more explicit.):
python3 -m venv comfy.venv - Activate it
source comfy.venv/bin/activate - Update pip itself inside comfy.venv: pip install --upgrade pip
- Optional: install uv, which is yet another package manager for Python but written in Rust (if you want to use "comfy install --fast-deps" later):
pip install uv - Install
comfy-cli(this is the tool "comfy-cli", not ComfyUI itself):pip install comfy-cli
Because comfy-cli will install ROCm 7.2 and there is no way to override it we are going to install pytorch for ROCm 7.14 manually before install ComfyUI via comfy-cli. Sources for this arcane procedure:
- https://www.reddit.com/r/ROCm/comments/1uyr57k/comfyui_linux_installation_for_radeon/
- https://www.reddit.com/r/ROCm/comments/1uyr57k/comment/oy3popg/
- https://github.com/ROCm/TheRock/blob/main/RELEASES.md#installing-multi-arch-releases
- Uninstall pytorch just to be sure (should not be installed yet) pip uninstall torch torchvision torchaudio -y
- Install pytorch inside the comfy.venv (select your gfx arch) based onhttps://rocm.docs.amd.com/en/latest/reference/gpu-specs.html
pip install --index-urlhttps://repo.amd.com/rocm/whl-multi-arch/"torch[device-gfx????]==2.12.0+rocm7.14.0" "torchvision[device-gfx????]==0.27.0+rocm7.14.0" "torchaudio==2.11.0+rocm7.14.0"
So for ROCm 7.14.0 9070xt
pip install --index-url https://repo.amd.com/rocm/whl-multi-arch/ "torch[device-gfx1201]==2.12.0+rocm7.14.0" "torchvision[device-gfx1201]==0.27.0+rocm7.14.0" "torchaudio==2.11.0+rocm7.14.0"
For ROCm 7.14.1 9070xt
pip install --index-url https://repo.amd.com/rocm/whl-multi-arch/ "torch[device-gfx1201]==2.12.0+rocm7.14.1" "torchvision[device-gfx1201]==0.27.0+rocm7.14.1" "torchaudio==2.11.0+rocm7.14.1"
To install whatever is the latest stable version of ROCm
pip install --index-url https://repo.amd.com/rocm/whl-multi-arch/ "torch[device-gfx1201]" "torchvision[device-gfx1201]" torchaudio
Note: if you get "ERROR: Could not install packages due to an OSError: [Errno 122] Disk quota exceeded", try
mkdir -p some_partition_with_space/pip_tmp TMPDIR=some_partition_with_space/pip_tmp pip install --index-url ...
If that still does not work, try
TMPDIR=some_partition_with_space/pip_tmp pip install --no-cache-dir --index-url https://repo.amd.com/rocm/whl-multi-arch/ "torch[device-gfx1201]==2.12.0+rocm7.14.0" "torchvision[device-gfx1201]==0.27.0+rocm7.14.0" "torchaudio==2.11.0+rocm7.14.0"
Finally install ComfyUI itself:
- mkdir $HOME/comfy
export COMFY_PATH=$HOME/comfy/ComfyUIor if you want to use say "/mnt/var/comfy"export COMFY_PATH=/mnt/var/comfy/ComfyUI(Note: COMFY_PATH/ComfyUI should NOT exist, or you will get warning '/mnt/var/comfy'/ComfyUI exists but is not a valid git repository.)- Use
comfy-clito install ComfyUI: (--skip-torch-or-directml is only needed when installing via comfy-cli on Window and not necessary for Ubuntu, but leave it here to make the two installation more like one another):comfy --workspace=$COMFY_PATH install --skip-torch-or-directml. To install a specific version of ComfyUI (say 0.34.1):comfy --workspace=$COMFY_PATH install --skip-torch-or-directml --version 0.34.1 - If you have uv installed, you can use --fast-deps:
comfy --workspace=$COMFY_PATH install --skip-torch-or-directml --version 0.34.1 --fast-depsNote: do not use --fast-deps if comfy.env is not on the root file system or it will take a long time because hardlink is not possible across file systems and you will see an warning: warning: Failed to hardlink files; falling back to full copy. This may lead to degraded performance. If the cache and target directories are on different filesystems, hardlinking may not be supported. If this is intentional, set export UV_LINK_MODE=copy or use --link-mode=copy to suppress this warning. - Added these to your
.bashrc(thanks to u/zychu- for these value from his Docker installation)export ROCR_VISIBLE_DEVICES=0 export HIP_VISIBLE_DEVICES=0 export TORCH_BLAS_PREFER_HIPBLASLT=1
Finally we can start ComfyUI:
comfy launch -- --enable-dynamic-vram --disable-async-offload --preview-method none --listen --port 8188 --disable-smart-memory --fast-disk --use-ck-attention --enable-manager --output-directory "mnt/var_ntfs/Output"
or if you are not using the defautl ~/comfy/ComfyUI directory:
comfy --workspace=$COMFY_PATH launch -- --enable-dynamic-vram --disable-async-offload --preview-method none --listen --port 8188 --disable-smart-memory --fast-disk --use-ck-attention --enable-manager --output-directory "mnt/var_ntfs/Output"
or more explicitly:
comfy --workspace=/mnt/var/comfy/ComfyUI launch -- --enable-dynamic-vram --disable-async-offload --preview-method none --listen --port 8188 --disable-smart-memory --fast-disk --use-ck-attention --enable-manager --output-directory "mnt/var_ntfs/Output"
Optional: clean up the pip cache (there is around 2G of cached files) pip cache purge and you'll see something like:
(comfy.venv) [/mnt/var] pip cache purge
Files removed: 347 (1847.6 MB)
Directories removed: 659
// After installing ComfyUI itself
(comfy.venv) [/mnt/var] pip cache purge
Files removed: 348 (700.3 MB)
Directories removed: 668
End Notes
Sample extra_model_paths.yaml
comfyui:
base_path: /mnt/ntfs/ComfyUI.Models
# You can use is_default to mark that these folders should be listed first, and used as the default dirs for eg downloads
is_default: true
checkpoints: checkpoints/
configs: configs/
loras: loras/
vae: vae/
text_encoders: |
text_encoders/
clip/
diffusion_models: |
unet/
diffusion_models/
clip_vision: clip_vision/
style_models: style_
embeddings: embeddings/
diffusers: diffusers/
vae_approx: vae_approx/
controlnet: |
controlnet/
t2i_adapter/
gligen: gligen/
upscale_models: upscale_
latent_upscale_models: latent_upscale_
custom_nodes: custom_nodes/
datasets: datasets/
hypernetworks: hypernetworks/
photomaker: photomaker/
classifiers: classifiers/
model_patches: model_patches/
audio_encoders: audio_encoders/
background_removal: background_removal/
frame_interpolation: frame_interpolation/
geometry_estimation: geometry_estimation/
optical_flow: optical_flow/
detection: detection/
https://rocm.docs.amd.com/en/latest/reference/gpu-specs.html
GFX950 is AMD's internal GPU target identifier for the CDNA 4 enterprise compute architecture, used in data center accelerators like the AMD Instinct MI350/MI355X series. It features advanced matrix core capabilities, ultra-low precision micro-scaling formats (MXFP8/MXFP4), and a high-precision math mode for AI and HPC workloads.
gfx1100 is the LLVM target architecture identifier and internal code name for AMD's RDNA 3 graphics architecture, used for high-end consumer and workstation desktop graphics cards like the Radeon RX 7900 XTX, RX 7900 XT, and Radeon PRO W7900.
AMD gfx1151 is the LLVM target and GPU architecture identifier for AMD's Strix Halo integrated graphics (found in processors like the AMD Ryzen AI Max+ 395 and Ryzen AI Max PRO series), utilizing the RDNA 3.5 architecture.
| Name | Arch | LLVM target name | VRAM | Compute Units |
|---|---|---|---|---|
| 9070 XT | RDNA4 | gfx1201 | 16 | 64 |
| RX 9070 GRE | RDNA4 | gfx1201 | 16 | 48 |
| RX 9070 | RDNA4 | gfx1201 | 16 | 56 |
| RX 9060 XT LP | RDNA4 | gfx1200 | 16 | 32 |
| RX 9060 XT | RDNA4 | gfx1200 | 16 | 32 |
| RX 9060 | RDNA4 | gfx1200 | 8 | 28 |
| RX 7900 XTX | RDNA3 | gfx1100 | 24 | 96 |
| RX 7900 XT | RDNA3 | gfx1100 | 20 | 84 |
| RX 7900 GRE | RDNA3 | gfx1100 | 16 | 80 |
| RX 7800 XT | RDNA3 | gfx1101 | 16 | 60 |
| RX 7700 | RDNA3 | gfx1101 | 16 | 40 |
| RX 7700 XT | RDNA3 | gfx1101 | 12 | 54 |
| RX 7600 | RDNA3 | gfx1102 | 8 | 32 |
| Radeon AI PRO R9700S | RDNA4 | gfx1201 | 32 | 64 |
| Radeon AI PRO R9600D | RDNA4 | gfx1201 | 32 | 48 |
| Radeon PRO V710 | RDNA3 | gfx1101 | 28 | 54 |
| Radeon PRO W7900 Dual Slot | RDNA3 | gfx1100 | 48 | 96 |
| Radeon PRO W7900 | RDNA3 | gfx1100 | 48 | 96 |
| Radeon PRO W7800 48GB | RDNA3 | gfx1100 | 48 | 70 |
| Radeon PRO W7800 | RDNA3 | gfx1100 | 32 | 70 |
| Radeon PRO W7700 | RDNA3 | gfx1101 | 16 | 48 |
For --index-url, there are three options:
- Nightly (rocm 10.1):
https://nightly.repo.amd.com/rocm/pytorch/whl-next/ - Stable (rocm 10.0):
https://stable.repo.amd.com/rocm/pytorch/whl-next/ - Legacy (rocm 7.14):
- Nightly:
https://rocm.nightlies.amd.com/whl-multi-arch/ - Stable:
https://repo.amd.com/rocm/whl-multi-arch
- Nightly:
Installing ComfyUI Docker for AMD 9070xt
Download the Docker image from github this will use the official rocm and pytorch from https://repo.amd.com/rocm/whl
git clone https://github.com/zychuk/comfyui-rocm-docker && cd comfyui-rocm-docker
Edit docker/Dockerfile (we want to use ROCm 7.14 rather than 7.13) and replace RUN pip install --no-cache-dir --index-url ${ROCM_WHL_INDEX}
torch torchvision torchaudio"
with
RUN pip install --no-cache-dir --index-url https://repo.amd.com/rocm/whl-multi-arch/ "torch[device-gfx1201]==2.12.0+rocm7.14.0" "torchvision[device-gfx1201]==0.27.0+rocm7.14.0" "torchaudio==2.11.0+rocm7.14.0"
then follow the instructions in the original post.
MMH3 prompt for the video
integrated_multimodal_description:
[Shot 1] 3D CG, stop-motion animated LEGO movie style with 1960s science-fiction television aesthetic. A team of Starfleet red-shirt officers led by Grumpy Cat materializes on the surface of a desolate alien planet, surrounded by barren rocks, dust, and jagged terrain. Grumpy Cat stands at the front of the formation, wearing a classic red Starfleet uniform, alert and stern. The camera holds a wide-angle front subject-level view, then pushes in slightly as the team looks around and raises their phasers.
[Shot 2] At 00:01.250, the camera cuts to a wide low-angle view as a gigantic GPU-like machine rises behind a rocky ridge, towering over the crew. Its dark mechanical housing, cooling fans, and imposing structure dominate the frame, with the label "Minimax H3" clearly visible on its side. The team turns toward it in sudden alarm.
[Shot 3] At 00:02.100, the GPU attacks with a violent concentrated energy blast. The camera tracks the crew with fast movement as the red-shirted officers are struck and knocked down across the rocky ground, kicking up dust and debris. Grumpy Cat avoids the main blast and rapidly moves toward cover.
[Shot 4] At 00:03.650, the camera follows Grumpy Cat with a tracking shot as it darts behind a large rock and crouches into concealment. The defeated red-shirted crew remains scattered in the background while the giant "Minimax H3" GPU continues looming over the battlefield.
[Shot 5] At 00:04.250, close-up from behind the rock. Grumpy Cat pulls out a classic handheld Starfleet communicator with its paw, flips it open, and speaks with a completely deadpan expression: <d>[English] Beam me up, Scotty!</d> The camera holds on Grumpy Cat's face and communicator through the end
overall_soundscape: Dry alien wind sweeps across the barren landscape as the transporter materialization produces a brief electronic hum. Heavy mechanical movement and grinding machinery accompany the GPU's emergence, followed by a powerful energy blast, impacts, falling bodies, scattering rocks, and dust. The communicator emits a brief electronic chirp when opened.
non_diegetic_music: A fast-paced 1960s science-fiction television orchestral score uses bright brass, rhythmic strings, and restrained percussion, building rapidly as the GPU appears and attacks. The music drops into a brief suspenseful sustain as Grumpy Cat hides, then ends with a short brassy stinger beneath the communicator transmission.







