HOW TO RUN COLAB ON CPU (when google decides you had enough free gpu for the day. or the week)

on example of

  1. find a model you want to use in the second repo, say aom3. click "open in colab" button. you should be redirected to
    click "copy to drive" button in second top toolbar to get your own editable copy
  2. fork
    make sure to fork all branches, "Copy the main branch only" is ticked by default
  3. navigate to your fork, edit launch,py (you can do it right on github, pencil button on top right of code window)
    comment (#) or remove line
    torch_command = os.environ.get('TORCH_COMMAND', "pip install torch1.13.1+cu117 torchvision0.14.1+cu117 --extra-index-url")

replace it with
torch_command = os.environ.get('TORCH_COMMAND', "pip install torch torchvision torchaudio --extra-index-url")

  1. go to collab. remove second line (!pip install -q as xformers only work on gpu
  2. on fifth line, replace with your repo link
  3. on the last line, remove --xformers and add --skip-torch-cuda-test, it should look like
    !python --share --enable-insecure-extension-access --gradio-queue --skip-torch-cuda-test

And that's it. 20 steps 512x1024 euler runs for about 12 seconds.

Pub: 20 Feb 2023 09:03 UTC
Views: 2422