Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request]: Update to Python 3.11 for some performance gains #14115

Open
1 task done
Asteliks opened this issue Nov 26, 2023 · 11 comments
Open
1 task done

[Feature Request]: Update to Python 3.11 for some performance gains #14115

Asteliks opened this issue Nov 26, 2023 · 11 comments
Labels
enhancement New feature or request

Comments

@Asteliks
Copy link

Is there an existing issue for this?

  • I have searched the existing issues and checked the recent builds/commits

What would your feature do ?

I would like to request updating python and all the dependencies to the latest possible version. Implementing my suggestion will give the end user some sweet sweet performance gains:

Proposed workflow

  1. Check all the required dependencies for newer versions
  2. Try updating as much as possible
  3. Make sure the webui still works as intended if not try to fix it
  4. Make sure to update all the documentation (especially Windows installation instructions where it is recommended to install Python 3.10.6)
  5. Post a PR

Additional information

As of today the recommended version of Python is 3.10.6 (https://github.com/AUTOMATIC1111/stable-diffusion-webui#automatic-installation-on-windows). It is stated that this is due to Torch support, however since Torch 2.1 Python 3.11 seems to be supported https://pytorch.org/get-started/locally/#windows-python.

@Asteliks Asteliks added the enhancement New feature or request label Nov 26, 2023
@Asteliks
Copy link
Author

related to: #14107

@KohakuBlueleaf
Copy link
Collaborator

Have tried py311 for a while (over a month) on sd-webui
I can say it just works perfect.

But since some extension may rely on py310 or even older version. I would recommend to get a method to manage multiple python version compatible at the same time.

(Just change python version check and startup script maybe also a choice though)

@Alkador1
Copy link

how to do it ?

@Asteliks
Copy link
Author

It would seem that for some reason PyTorch went back to Python 3.10 on their getting started page for windows. On Linux they are allowing 3.11. So far I've been running stable-diffusion-webui on Linux with Python 3.12 without any issues but that doesn't mean much.

@Asteliks
Copy link
Author

Asteliks commented Jan 9, 2024

I've opened pytorch/pytorch#116569. It would seem that Python 3.11 is supported for all 3 OSes and the stated above was just a mistake.

@soulteary
Copy link

I'm a big fan of upgrading Python and Torch versions, I'm currently running SD and various SD WebUI projects in Nvidia containers and everything is working great. @Asteliks @Alkador1

Later, I will complete the complete manual installation tutorial in this ISSUE. You can follow it or make comments and suggestions. #14651

@LB22
Copy link

LB22 commented Mar 15, 2024

It seems as we can go even further and support python 3.12 by upgrading to torch 2.2

#15270

@KohakuBlueleaf
Copy link
Collaborator

It seems as we can go even further and support python 3.12 by upgrading to torch 2.2

#15270

Py3.12 don't have much performance gain so maybe we can directly wait for 3.13.

@richardtallent
Copy link
Contributor

3.12 is almost 6 months old. Going ahead with any refactoring needed to support it now (if any) will only make an upgrade to 3.13 easier later.

@Asteliks
Copy link
Author

According to the install page the highest supported version of python is 3.11. I don't think we should go above the highest supported versions. Source https://pytorch.org/get-started/locally/

image

@6DammK9
Copy link

6DammK9 commented Mar 26, 2024

I have tried fresh install with Python 3.12 today. I confirm that it won't work in A1111 along with major extension like mediapipe in sd-webui-controlnet.
Python 3.12 will force some dependency to upgrade and cause a lot of trouble, throwing a lot of errors even after overriding many dependency checkings.
Since my global / physical environment is already in 3.12, reinstalling them will be tedious, I install Python 3.10 without assigning PATH and then manually assign the venv in webui-user.bat instead:

set PYTHON=C:\Users\User\AppData\Local\Programs\Python\Python310\python.exe

How I go through the install progress and retreat from 3.12..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

7 participants