ComfyUI/MEMEDECK.md
2025-03-03 20:50:31 +00:00

1.6 KiB

Commands to set up the environment.

Enable MIGs on NVIDA GPU

https://www.seimaxim.com/kb/gpu/nvidia-a100-mig-cheat-sheat

sudo nvidia-smi -i 0 -mig 1
sudo nvidia-smi mig -cgi 9,9 -C

Start comfy with MIGs

CUDA_VISIBLE_DEVICES=MIG-0 python main.py --port 5000 --listen 0.0.0.0 --cuda-device 0 --preview-method auto

Tunnel remote server port to local machine port

On the server

sudo nano /etc/ssh/sshd_config

# uncomment this line in the sshd_config file
GatewayPorts yes

Then restart the machine.

On your local machine

sudo ssh -i ~/.ssh/memedeck-monolith.pem -N -R 9090:localhost:8079 holium@172.206.15.40 

install autossh (maybe not needed)

brew install autossh
autossh -M 0 -o "ServerAliveInterval 30" -o "ServerAliveCountMax 3" -i ~/.ssh/memedeck-monolith.pem -N -R 9090:localhost:8079 holium@172.206.15.40

On the server

This is to allow the port to be accessed from the local machine.

sudo iptables -A INPUT -p tcp --dport 9090 -j ACCEPT

Quick start for dev

# ssh into to the server
ssh -i ~/.ssh/memedeck-monolith.pem holium@172.206.15.40

# on a100 server
API_ADDRESS='http://localhost:9090/v2' API_KEY='<your-api-key>' AMQP_ADDR='amqp://api:gacdownatravKekmy9@51.8.120.154:5672/dev' python main.py --port 5001 --listen 0.0.0.0 --cuda-device 0 --preview-method auto

# on local machine
ssh -N -R 9090:0.0.0.0:8079 -i ~/.ssh/memedeck-monolith.pem holium@172.206.15.40