This guide will show you how to run Disco Diffusion locally, if you run in the any errors, you should check out this page.
- Install VS code and python
- Download the AI code from here
- Extract the ZIP folder you just downloaded with the files app and open it in VS code from the files menu in VS code
- Press ctrl+shift+` simultaneously to open a terminal tab
- Type
python3 -m venv venv
in the terminal to create a python virtual environment, this is necessary to keep different dependencies separate - Type
source ./venv/bin/activate
if you are using linux or macOS or./venv/Scripts/activate.ps1
if you are using windows - Download the model files from these links and move them into the content folder: base model and secondary model
- In the terminal type
pip3 install -r requirements.txt
- Then, type one of the following commands based on your computer’s OS:
pip3 install torch==1.10.2+cu113 torchvision==0.11.3+cu113 torchaudio===0.10.2+cu113 -f https://download.pytorch.org/whl/cu113/torch_stable.html
for windows,pip3 install torch torchvision torchaudio
for macOS, orpip3 install torch==1.10.2+cu113 torchvision==0.11.3+cu113 torchaudio==0.10.2+cu113 -f https://download.pytorch.org/whl/cu113/torch_stable.html
for linux - If using CPU, find line 226 in main.py (click on that file in the file menu in the left in VS code) and edit the
False
toTrue
(skip this step if you want to run the AI on your GPU) - In the terminal type
python3 main.py
- Wait for the image to finish, you can view progress in the file
progress.png
(Open it the same way as you opened main.py, or open it in your computer’s file app) - Great job, you’re done! If you have any questions, please ask them here, but if you get any errors, ask about them in the errors page
If you want to change the version (update to a newer notebook) follow these steps:
- In colab, download the .ipynb file and move it to the same path as the main.py file.
- Open that file in VS code and follow VS code suggestions for ipynb files.
- You may need to install some extra dependencies, if you don’t know how, you can comment on this page and I will try to help.
- That’s all, just run the cells in the ipynb file.
Hint: This AI requires a lot of VRAM to make large images, it’s suggested to make medium images and then upscale them.
Thanks. When you write “skip this step if you want to run the AI on your GPU” can you clarify if it’s possible to run on a local GPU if that GPU is not an NVIDIA one? As far as I know that’ snot possible yet? I’m on macbook Pro with an M1Pro chip.
You need either a NVIDIA GPU or a radeon GPU. It’s harder to get a radeon GPU to work though.
Cheers. But I don’t think the M1 Macbooks can do eGPUs due to the absence of ARM drivers so that’s not currently an option, alas. 🙁
Is there any info on how to do it?
Thanks!
How to do what (apple or radeon device)?
Sorry, I meant Radeon. Couldn’t find any info on how to proceed. Thanks!
You need to install a different version of pytorch: https://pytorch.org/get-started/locally/
After running the install -r requirements.txt command. I get
ERROR: Could not find a version that satisfies the requirement torch==1.10.2+cu113
Use the command shown here based on your OS (select pip): https://pytorch.org/get-started/locally/
raise you python version.
Do you know of any way to use the SLIPB16 or SLIPL16 models?
You need to manually download the files, but it’s recommended that you don’t, they aren’t as good as CLIP models.
I see. Thanks!
I can’t seem to download the AI zip file. Whenever I click on the link nothing happens…
Paste this link in a browser: files.botbox.dev/discoAI/download/main.zip
Which content folder are we supposed to put the base model and secondary model? Mac and Windows.
a folder called content that is in the same directory as the main python file.
Thanks. The content folder in the ‘main’ inside VSCode? Am I right?
can you use multiple GPUS?
Not easily
any updated on v4 or v5 source code for local running?
You can download the ipynb file from google colab and put it in the same directory as the main.py file and just run that, however, 3D in v5 does not work on windows.
Thanks so much for taking the time to share your knowledge. Have you used the the discoV5 local approach in any of you own work? Do you notice a huge difference even in stills?
This is great, I am hitting an error when I try and source the activate script though>
source ./venv/Scripts/activate.ps1
source : The term ‘source’ is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, o
verify that the path is correct and try again.
At line:1 char:1
+ source ./venv/Scripts/activate.ps1
Sorry I just saw the Errors Page!
Sorry I just saw the Errors Page!
These instructions don’t seem to work for Windows. Running Python3 from a command prompt just brings me to the Windows Store. Also, when opening Visual Studio Code it asks if I want to installed recommended dependencies for Python. Should we do that?
Yes, you need to install the recommended dependencies in VS code, and sometimes you need to install python from the windows store, it means python wasn’t added to path.
Hey thank you for putting this guide together. I got this working and did two images both 640×480 and took 12 minutes each. However, when I look at my task manager it shows my CPU at 33% but GPU at 1%. I have a nvidia RTX 3090. I checked my installation of pytorch and within pytorch ran the commands to check if cuda is enabled and compatible and it picks up the right device id and also shows the device name but I cannot get disco diffusion to use my gpu. I have set CPU to False on the line 226.
Task manager would be wrong then, if you were running it on CPU, those images would take well over 12 minutes.
Hi im struggling with updating the version to the newest one, I’m having issues such as torch and cv2 not being found, i think its an issue with the pip installer as its not installing the dependencies, any suggestions?
It is, have you tried “pip install opencv-python”? Then install torch using the command on this page: https://pytorch.org/get-started/locally/
ok so few questions,
do i use jupyter server? do i need to install all this through the terminal in visual studio code and will the pip installer sort out the wget error i get as well as the !git expression?
many thanks
Dylan
all the requirements are already satisfied for torchvision and pip.
I ran the console using menu view->terminal (not the shortcut ctrl+shift+`)
is it OK? I can’t use “` ” due to keyboard malfunction.
When I typed “python3 -m venv venv” I got:
“PS D:\Users\Adam\Downloads\DD\main> python3 -m venv venv
Nie mo
PS D:\Users\Adam\Downloads\DD\main>”
“Nie mo” is probably an error code (i use Polish Windows it can be truncated “Nie mozna” equals “you can’t”
What should I do?
I’ve actually never seen that error before, I’d recommend installing WSL (ubuntu distro) and following the linux instructions.
Hi there, could you give an example of how to use the
init_image = ” #@param{type: ‘string’}
Thanks
You put a filepath for the image you want between the double quotes (“”).
Thanks so much I was using ‘these’, not “these”…. doh 🙂
looks like this website got hacked. “click here to enable notifications”? no thank you
No, it was not hacked, it’s a test of a very bad system for ads that I changed.
I keep trying many times but it keep show me that vent is not work, can’t find it,…… I don.t know how to fix it….
PS C:\Python310\main> python3 -m venv venv
PS C:\Python310\main> ./venv/Scripts/activate
./venv/Scripts/activate : 无法将“./venv/Scripts/activate”项识别为 cmdlet、函数、脚本文件或
可运行程序的名称。请检查名称的拼写,如果包括路径,请确保路径正确,然后再试一次。
所在位置 行:1 字符: 1
+ ./venv/Scripts/activate
+ ~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (./venv/Scripts/activate:String) [], CommandN
otFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
Sometimes this means you have the wrong python, try using WSL (ubuntu) and instsalling python with “sudo apt install python3-venv”
I have a basic 3080fe, will this be able to run 768×768 images? I don’t mind if it takes a couple hours, would love to put it to use for this and not depend on being able to get assigned a GPU from google.
A 3080 should take a couple minutes for a 768^2 image (12GB VRAM is a little low for some customization though)
If using WSL2, do I have to follow the same instructions including VSCode…?
For all installs, yes
Thanks again for the documentations.
I’m using WSL2,
When running Python3 main.py I get this!
RuntimeError: CUDA error: unknown error
CUDA kernel errors might be asynchronously reported at some other API call,so the stacktrace below might be incorrect.
For debugging consider passing CUDA_LAUNCH_BLOCKING=1.
When entering python3 main.py to run the script, I get No Such File or Directory. Amending it to find the path of the downloaded ‘main’ folder (so python3 ./Downloads/main/main.py) runs the script, but results in:
./Downloads/main/main.py:1200: SyntaxWarning: “is not” with a literal. Did you mean “!=”?
if steps_per_checkpoint is not 0 and intermediates_in_subfolder is True:
filepath ./content/init_images exists.
filepath ./content/images_out exists.
filepath ./content/models exists.
Traceback (most recent call last):
File “./Downloads/main/main.py”, line 191, in
import timm
ModuleNotFoundError: No module named ‘timm’
Type “python3 -m pip install timm”
It will not work when I type “python3” it’ll only work if I type
“python”
If I type “Python3” I get
Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases.
Add python to path and restart your computer OR change “python” to “py”
Hi there, I’ve got this ERROR, what should I do?
ERROR: Could not find a version that satisfies the requirement pywin32==303 (from versions: none)
ERROR: No matching distribution found for pywin32==303
Are you on windows?
Mac OS
Then you won’t be able to import that, it’s for windows.
Which version are you using?
I’m on macOS Monterey 12.2.1 (21D62), I’ve got this for the last step.
(venv) x1ao4@x1ao4s-iMac-215 main % python3 main.py
/Users/x1ao4/Documents/main/main.py:1200: SyntaxWarning: “is not” with a literal. Did you mean “!=”?
if steps_per_checkpoint is not 0 and intermediates_in_subfolder is True:
filepath ./content/init_images exists.
filepath ./content/images_out exists.
filepath ./content/models exists.
Using device: cuda:0
512 Model already downloaded, check check_model_SHA if the file is corrupt
Traceback (most recent call last):
File “/Users/x1ao4/Documents/main/main.py”, line 1080, in
secondary_model.load_state_dict(torch.load(f'{model_path}/secondary_model_imagenet_2.pth’, map_location=’cpu’))
File “/Users/x1ao4/Documents/main/venv/lib/python3.10/site-packages/torch/serialization.py”, line 699, in load
with _open_file_like(f, ‘rb’) as opened_file:
File “/Users/x1ao4/Documents/main/venv/lib/python3.10/site-packages/torch/serialization.py”, line 231, in _open_file_like
return _open_file(name_or_buffer, mode)
File “/Users/x1ao4/Documents/main/venv/lib/python3.10/site-packages/torch/serialization.py”, line 212, in __init__
super(_open_file, self).__init__(open(name, mode))
FileNotFoundError: [Errno 2] No such file or directory: ‘./content//secondary_model_imagenet_2.pth’
I‘ve fixed the FileNotFoundError, but I’m getting this now.
/Users/x1ao4/Documents/main/main.py:1200: SyntaxWarning: “is not” with a literal. Did you mean “!=”?
if steps_per_checkpoint is not 0 and intermediates_in_subfolder is True:
filepath ./content/init_images exists.
filepath ./content/images_out exists.
filepath ./content/models exists.
Using device: cuda:0
512 Model already downloaded, check check_model_SHA if the file is corrupt
Secondary Model already downloaded, check check_model_SHA if the file is corrupt
Traceback (most recent call last):
File “/Users/x1ao4/Documents/main/main.py”, line 1081, in
secondary_model.eval().requires_grad_(False).to(device)
File “/Users/x1ao4/Documents/main/venv/lib/python3.10/site-packages/torch/nn/modules/module.py”, line 907, in to
return self._apply(convert)
File “/Users/x1ao4/Documents/main/venv/lib/python3.10/site-packages/torch/nn/modules/module.py”, line 578, in _apply
module._apply(fn)
File “/Users/x1ao4/Documents/main/venv/lib/python3.10/site-packages/torch/nn/modules/module.py”, line 601, in _apply
param_applied = fn(param)
File “/Users/x1ao4/Documents/main/venv/lib/python3.10/site-packages/torch/nn/modules/module.py”, line 905, in convert
return t.to(device, dtype if t.is_floating_point() or t.is_complex() else None, non_blocking)
File “/Users/x1ao4/Documents/main/venv/lib/python3.10/site-packages/torch/cuda/__init__.py”, line 210, in _lazy_init
raise AssertionError(“Torch not compiled with CUDA enabled”)
AssertionError: Torch not compiled with CUDA enabled
You’ll need a CUDA GPU OR you must use step 10.
I did step 10, and now I have this error.
urllib.error.URLError:
urllib.error.URLError: urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:997)
How do you fix it? I’m getting the same error while I’m on a Linux system.
Don’t know how to fix it, I quit.
Here are the steps for the macOS:
1. In the Applications folder, find the Python folder
2. Double click on the “Install Certificates.command”. It will open a terminal and install the certificate.
Source:
https://stackoverflow.com/questions/68275857/urllib-error-urlerror-urlopen-error-ssl-certificate-verify-failed-certifica
I’m on macOS Monterey 12.2.1 (21D62), I’ve got this for the last step.
(venv) x1ao4@x1ao4s-iMac-215 main % python3 main.py
/Users/x1ao4/Documents/main/main.py:1200: SyntaxWarning: “is not” with a literal. Did you mean “!=”?
if steps_per_checkpoint is not 0 and intermediates_in_subfolder is True:
filepath ./content/init_images exists.
filepath ./content/images_out exists.
filepath ./content/models exists.
Using device: cuda:0
512 Model already downloaded, check check_model_SHA if the file is corrupt
Traceback (most recent call last):
File “/Users/x1ao4/Documents/main/main.py”, line 1080, in
secondary_model.load_state_dict(torch.load(f'{model_path}/secondary_model_imagenet_2.pth’, map_location=’cpu’))
File “/Users/x1ao4/Documents/main/venv/lib/python3.10/site-packages/torch/serialization.py”, line 699, in load
with _open_file_like(f, ‘rb’) as opened_file:
File “/Users/x1ao4/Documents/main/venv/lib/python3.10/site-packages/torch/serialization.py”, line 231, in _open_file_like
return _open_file(name_or_buffer, mode)
File “/Users/x1ao4/Documents/main/venv/lib/python3.10/site-packages/torch/serialization.py”, line 212, in __init__
super(_open_file, self).__init__(open(name, mode))
FileNotFoundError: [Errno 2] No such file or directory: ‘./content//secondary_model_imagenet_2.pth’
That’s one of the models you need to download, put the file called that in the content folder.
Hi Eliso
What versions are you running of VSL ? Python? CUDA? or is whatever is the latest ok
thanks
W.
The only version that matters is python must be 3.9.
Error:
Could not find a version that satisfies the requirement fonttools==4.29.1
(from -r requirements.txt (line 19)) (from versions: 2.3, 2.4 …, 4.27.0, 4.27.1)
Is it ok for me to switch to 4.27.1 for example?
That should work fine.
Is there a version requirement for Python3? Thx
3.7 to 3.9
Thanks for sharing, I am also trying to build a local running environment of Disco Diffusion locally. I am using NVIDIA RTX 2080 8G memory graphics card, and have installed cuda11.1 toolkit, pycharm, and pytorch-related versions. Test cuda can be used. I tried to debug disco.py (the latest version of v5.2) in pycharm, and encountered some problems. I am not very proficient in Python, and I hope you can enlighten me.
Output()
0%| | 0/240 【00:01<?, ?it/s】
Seed used: 2902854816
Traceback (most recent call last):
File "C:\PyCharm Community Edition 2021.3.3\plugins\python-ce\helpers\pycharm\docrunner.py", line 305, in
modules = [loadSource(a【0】)]
File “C:\PyCharm Community Edition 2021.3.3\plugins\python-ce\helpers\pycharm\docrunner.py”, line 237, in loadSource
module = _load_file(moduleName, fileName)
File “C:\PyCharm Community Edition 2021.3.3\plugins\python-ce\helpers\pycharm\docrunner.py”, line 209, in _load_file
return machinery.SourceFileLoader(moduleName, fileName).load_module()
File “”, line 529, in _check_name_wrapper
File “”, line 1029, in load_module
File “”, line 854, in load_module
File “”, line 274, in _load_module_shim
File “”, line 711, in _load
File “”, line 680, in _load_unlocked
File “”, line 850, in exec_module
File “”, line 228, in _call_with_frames_removed
File “C:/disco-diffusion-main/disco.py”, line 2526, in
do_run()
File “C:/disco-diffusion-main/disco.py”, line 1336, in do_run
for j, sample in enumerate(samples):
File “C:\disco-diffusion-main\guided-diffusion\guided_diffusion\gaussian_diffusion.py”, line 892, in ddim_sample_loop_progressive
out = sample_fn(
File “C:\disco-diffusion-main\guided-diffusion\guided_diffusion\gaussian_diffusion.py”, line 674, in ddim_sample
out = self.condition_score(cond_fn, out_orig, x, t, model_kwargs=model_kwargs)
File “C:\disco-diffusion-main\guided-diffusion\guided_diffusion\respace.py”, line 102, in condition_score
return super().condition_score(self._wrap_model(cond_fn), *args, **kwargs)
File “C:\disco-diffusion-main\guided-diffusion\guided_diffusion\gaussian_diffusion.py”, line 399, in condition_score
eps = eps – (1 – alpha_bar).sqrt() * cond_fn(
File “C:\disco-diffusion-main\guided-diffusion\guided_diffusion\respace.py”, line 128, in __call__
return self.model(x, new_ts, **kwargs)
File “C:/disco-diffusion-main/disco.py”, line 1243, in cond_fn
t_int = int(t.item())+1 #errors on last step without +1, need to find source
ValueError: only one element tensors can be converted to Python scalars
I don’t know enough about pytorch to solve that for you, try asking in the pytorch subreddit.
ModuleNotFoundError: No module named ‘resize_right
When trying to run main.py
Try “git clone https://github.com/assafshocher/ResizeRight.git“
Download the AI code from here , it doesn’t work for me to download the ai code from here
That’s happened to multiple people, try using a different browser, or using “curl https://files.botbox.dev/discoAI/download/main.zip -o main.zip” in powershell.
Do you know whether a Diffusion model has been successfully run on in an Ubuntu 16.04 ppc64el operating environment? I think I can get access to one of these, but the instructions above seem to be for X86_64(=Intel) and ARM architectures.
Continuing thanks!
Probably should work
Hi I’m getting this error:
Traceback (most recent call last):
File “C:\Program Files\Graphics\DiscoDiffusion\main.py”, line 208, in
from models import SLIP_VITB16, SLIP, SLIP_VITL16
ModuleNotFoundError: No module named ‘models’
That’s strange, the folders are probably wrong
Where should I place the AI code files then?
I don’t actually know how the folders have to be to work, hopefully someone else can help.
On step 6 I get the following:
bash: ./venv/bin/activate: Permission denied
[ Hackintosh running High Sierre vs 10.13.6, with NVIDIA GeForce GTX 1080 (Cuda v418.163) ]
Then use “sudo ./venv/bin/activate”
you forgot “source”, try “source ./venv/bin/activate”
That’s for linux, on windows you use either “./venv/bin/activate.bat” or “./venv/bin/activate.ps1”
I’ve downloaded v5.2 ipynb file from colab and put it in the same directory as main.py. But how do I run it from the venv in terminal with all dependencies installed? If I hit ‘Run all’ it gives me a whole bunch of errors in the problems tab.
Set the venv in VS code
pip3 install -r requirements.txt, I get the error “Could not open requirements file: [Errno 2] No such file or directory: ‘requirements.txt”
You’re missing the requirements.txt file, try again to download all the AI files.
Thank you for the quick response, it seems that “Download the AI code from *here*” is no longer working. Could you reupload these again? Thank you
People have been having this issue, try a different browser.
Another cause for this might be the requirements.txt is in the sub-folder “main”.
ERROR: Could not install packages due to an OSError: [WinError 5]
I got this error when installing the requirements. How to get the administrator level permission in the virtual environment?
Put “–user” at the end of the command
can’t use –user in a virtual environment, right?
You probably still can, but if not, I’m not sure
Hi i’m trying to use disco diffusion and google sent me here. I have an error on ( https://colab.research.google.com/github/alembics/disco-diffusion/blob/main/Disco_Diffusion.ipynb#scrollTo=DoTheRun )
when i try to run the “Do the run!” i always have this error :
”
Starting Run: TimeToDisco(0) at frame 0
—————————————————————————
NameError Traceback (most recent call last)
in ()
68 print(f’Starting Run: {batch_name}({batchNum}) at frame {start_frame}’)
69
—> 70 if set_seed == ‘random_seed’:
71 random.seed()
72 seed = random.randint(0, 2**32)
NameError: name ‘set_seed’ is not defined
”
I don’t know how to code but someone here may know ? Thanks !
Never seen this error before, try asking in the disco diffusion subreddit
How do I change the main.py code to load an initial image? This is what I did on line 1149:
init_image = f’./content/init_images/IMG_0199.jpg’ #@param{type: ‘string’},
so trying to tell it to load the image from the init_images folder, but the image isn’t loaded. Probably I’m using the wrong syntax. So help is very welcome!
Is there any error? or just nothing happens? If the second, there should be a setting that makes it use an init image (bool setting, True/False)
No error, just nothing happens. Can you confirm that my syntax for loading an image from a folder is correct? And also can you tell me the line number where this boolean value is set?
I don’t know which line right now, I will check later, but try ctrl+f and type init to find it.
I did study the main.py code, but there is no true/false setting for an initial image. When you put in the name, as a string, of the image file into line 1149, the code knows that an initial image is used. But then it gives an error of FileNotFound: no such file or directory. So this is my main issue: where to put the image file so it can be found? (I did study the code of the colab and it seems the file is located at the root level. Is this right?)
Put a full file path, make sure that you don’t include any “\”s (backslashes). If you need one in the path, replace it with “\\”. (escaping it)
Ah, finally the image is loaded! I’m on a Mac, so my path looks different form the Windows one. Also I did set skip_timesteps (line 1152 in the code), to 50% of the “steps”, as recommended on colab notebook. This settings then shows the initial image.
In my case the path is: ‘/Users/SWB/Desktop/P1020064.jpg’ (so the image is on my desktop).
Thanks for your help!
Is there a way to stop or pause it when doing a batch?
Not within the code, but you could sleep your computer or the program.
@eliso – a very big thank-you for sharing this tutorial!
AssertionError: Torch not compiled with CUDA enabled
My GPU is CUDA capable, is the the version of pytorch not compatible?
note: I get the error “AssertionError: Torch not compiled with CUDA enabled” when using the command “”python main.py”
when I use “python3 main.py”
I get the error “ModuleNotFoundError: No module named ‘timm'” and no matter how many times I Pip install timm its always missing
You’re probably installing to the wrong python.
Exactly
could you elaborate? I apologize I’m not very good with code
Find the right command here: https://pytorch.org/get-started/locally/
I still get the same errors after installing a later release, is there something I’m missing?
Not sure, do you have the correct version of cuda installed? Are you installing it to the same python you’re running?
I can try and update cuda on my pc, also I can be sure I’m installing it to the same python? Thank you for help so far I really appreciate it
*How can I be*
Hey there,
Thanks for the tutorial, I was able to get the AI running with relatively few issues. Just needed to use slightly different commands.
But I had a question about output. The DDv5.2 Colab has an output viewer that shows the most recent save. Is there a way to output the most recent frame saved when running this locally? I’d like to hook it up to a streaming software so I can view the progress of some of these.
Thanks!
Each save is saved to a file, you can also edit the save variables to save more often.
I fixed ”AssertionError: Torch not compiled with CUDA enabled” by changing my Python environment from 3.18 to 3.8 using py -3.8 venv venv and downloading an older version of pytorch. I hope this helps with anyone who has the same problem!
*3.10 to 3.8*
Thank you very much for putting this guide together, much appreciated.
I was thinking about renting 3090 with 2 GPU´ on vast.ai or somewhere else. I want to be able to run DD much faster and not run out of memory. However… somebody mentioned that Disco diffusion is only capable of running on 1 GPU. does anybody have any knowledge about this?
Thanks!
It’s true that it can only run on one GPU, unless you get nvlink.
Thanks very much. I was able to get this up and running but with several modifications: https://docs.google.com/document/d/1GmXX-MRFFaWF3pbI5zZ_z7K4AZCQ1nfNFc7GSljUgYo/edit?usp=sharing
Let me know if those are not correct. They worked for me on Win 11 and 3090.
Several questions:
1, Specifically, *how* do I update this so that it uses the latest AI libraries (or does it automate that itself?). I think I understand that main.py is only a DD 4 version– how to I update to the latest version?
2. Is it possible to run this using the same browser interface locally? I know you can find “connect to a local runtime” in colab but it seems to need something called jupiter and a server. Any help would be much appreciated!
You’d need to use linux for colab local runtime, and you update by downloading the ipynb file from colab and running it in VS code.
Thanks for that. I ended up punting and just using:
https://gist.github.com/MSFTserver/a05f637f32302918dd893318a4d9f62b
Can this main.py only generate elements with boats and clouds?
Sorry, I found a place to change the code
Traceback (most recent call last):
File “C:\Users\riaan\documents\ai\main\main.py”, line 1081, in
secondary_model.eval().requires_grad_(False).to(device)
File “C:\Users\riaan\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\torch\nn\modules\module.py”, line 927, in to
return self._apply(convert)
File “C:\Users\riaan\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\torch\nn\modules\module.py”, line 579, in _apply
module._apply(fn)
File “C:\Users\riaan\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\torch\nn\modules\module.py”, line 602, in _apply
param_applied = fn(param)
File “C:\Users\riaan\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\torch\nn\modules\module.py”, line 925, in convert
return t.to(device, dtype if t.is_floating_point() or t.is_complex() else None, non_blocking)
File “C:\Users\riaan\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\torch\cuda\__init__.py”, line 211, in _lazy_init
raise AssertionError(“Torch not compiled with CUDA enabled”)
AssertionError: Torch not compiled with CUDA enabled
Thanks for taking the time to post this guide and troubleshooting. I’ve been busy a few hours now but can’t get passed this error. Any help appreciated.
after a restart and running it again I get:
File “c:\Users\riaan\Documents\AI\main\main.py”, line 206, in
import clip
ModuleNotFoundError: No module named ‘clip’
Any ideas?
Try running this command: “pip install https://github.com/openai/CLIP.git” if that fails, try this: “git clone https://github.com/openai/CLIP.git“
Thanks! I get this error on the first:
Downloading https://github.com/openai/CLIP.git
– 222.6 kB 388.8 kB/s 0:00:00
ERROR: Cannot unpack file C:\Users\riaan\AppData\Local\Temp\pip-unpack-ic6gizn2\CLIP.git (downloaded from C:\Users\riaan\AppData\Local\Temp\pip-req-build-avv3oqjl, content-type: text/html; charset=utf-8); cannot detect archive format
ERROR: Cannot determine archive format of C:\Users\riaan\AppData\Local\Temp\pip-req-build-avv3oqjl
And this on the second option:
git : The term ‘git’ is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try
again.
At line:1 char:1
+ git clone https://github.com/openai/CLIP.git
+ ~~~
+ CategoryInfo : ObjectNotFound: (git:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
I installed GIT and the second option then worked, thanks!
Now onto the next error:
from resize_right import resize
ModuleNotFoundError: No module named ‘resize_right’
🙂
Try one of these two: “pip install resize-right” and “https://github.com/assafshocher/ResizeRight.git”
Thanks!
Now I’m back here again:
AssertionError: Torch not compiled with CUDA enabled
I’m giving up for now, thanks for your time though
OK So it’s working now!
I had to add some paths to enviro PATHS after adding torch.
Thanks for your help!
How can one save the images to set directory when the batch number is increased?
There’s a variable called intermediate saves (or something like that), set it to 1.
Hello. Thank you for all of this. I managed to get it running tough I’m just a graphic designer. I don’t know much about CLI and coding, but I see on PyTorch a version for ARM Mac with GPU Metal support. Is there a way to get that running instead of “AssertionError: Torch not compiled with CUDA enabled”?
If you don’t have a nvidia or AMD GPU, you will need to use CPU.
Thank you very much for clarifying this. Does anyone know of a GAN AI similar to disco diffusion that takes advantage of the M1 Ultra arm cpu?
Can you elaborate on upgrading to a new version of DD? How do you run cells? When I opened the ipynb file I didn’t get any prompts about how to handle it, just read it like a webpage.
Tried doing “Run” with and without debugging from the top menu and got a message about “null” is not defined.
Thanks.
You need to run each cell individually, with the button to the left of the cell.
Thanks, didn’t realize it was the same as doing it from the website (which I haven’t used either).
Looks like I’ll see you on the errors page!
is the file uploaded here the latest version of disco diffusion?