Compfyui: tanpa GPU

From OnnoWiki
Revision as of 17:19, 29 March 2025 by Onnowpurbo (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Kalau kamu ingin install **ComfyUI** (Comfy UI) di sistem **tanpa GPU**, seperti di laptop biasa yang cuma pakai CPU, kamu tetap bisa install dan menjalankannya—cuma nanti prosesnya akan **sangat lambat**, terutama untuk generate gambar, karena ComfyUI biasanya pakai model Stable Diffusion yang berat.

Berikut langkah instalasi **ComfyUI di Windows tanpa GPU (CPU only)**:

---

      1. ✅ **Langkah 1: Install Python**

1. Download Python 3.10.6 dari sini: https://www.python.org/downloads/release/python-3106/ 2. Saat install, **centang opsi "Add Python to PATH"**. 3. Selesai install, buka Command Prompt dan ketik:

  ```
  python --version
  ```
  Harus muncul versi 3.10.x

---

      1. ✅ **Langkah 2: Clone ComfyUI**

1. Buka Command Prompt atau Git Bash. 2. Jalankan:

  ```
  git clone https://github.com/comfyanonymous/ComfyUI.git
  cd ComfyUI
  ```

---

      1. ✅ **Langkah 3: Install Dependensi**

Ketik: ``` python -m venv venv venv\Scripts\activate pip install -r requirements.txt ```

---

      1. ✅ **Langkah 4: Gunakan CPU Mode**

Buka file `web\server.py` dan edit bagian `torch.set_default_tensor_type` agar menggunakan CPU. Tapi cara paling mudah adalah jalankan dengan environment variable berikut:

``` set PYTORCH_ENABLE_MPS_FALLBACK=1 set CUDA_VISIBLE_DEVICES="" python main.py ```

Atau langsung satu baris (di PowerShell): ``` $env:CUDA_VISIBLE_DEVICES=""; python main.py ```

---

      1. ✅ **Langkah 5: Tambah Model Stable Diffusion**

1. Download model `v1-5-pruned.ckpt` (Stable Diffusion 1.5) dari HuggingFace (perlu akun):

  [1](https://huggingface.co/runwayml/stable-diffusion-v1-5)

2. Taruh file `.ckpt` atau `.safetensors` ke folder:

  ```
  ComfyUI\models\checkpoints\
  ```

---

      1. ✅ **Langkah 6: Jalankan ComfyUI**

``` python main.py ```

Buka browser ke: `http://127.0.0.1:8188`

---

      1. ⚠️ PERINGATAN:

- **Tanpa GPU**, proses bisa butuh waktu **5–15 menit** atau lebih **untuk satu gambar**, tergantung model dan ukuran. - ComfyUI akan tetap bisa berjalan, tapi memang tidak optimal tanpa GPU.


Pranala Menarik