lllyasviel / Fooocus

Focus on prompting and generating
GNU General Public License v3.0
40.52k stars 5.65k forks source link

[Feature Request]: Python3.12 compatibility #2938

Closed 9er closed 2 months ago

9er commented 4 months ago

Is there an existing issue for this?

What would your feature do?

I tried installing the PIP requirements with python 3.12.3, but it fails in several places. I have upped some packages:

-pyyaml==6.0
+pyyaml==6.0.1

-scipy==1.9.3
+scipy==1.11.4

-onnxruntime==1.16.3
+onnxruntime==1.17.3

The first one is already in #2927.

And I get much further, but then cargo explodes

      error: `cargo rustc --lib --message-format=json-render-diagnostics --manifest-path Cargo.toml --release -v --features pyo3/extension-module --crate-type cdylib --` failed with code 101

So here I'm out of ideas. I assume that there are some fixes neccessary for python 3.12 and that someone is smarter than me and knows what to do :)

Proposed workflow

(there's documentation for installing Fooocus, so it should work with recent python versions)

Additional information

No response

blckbx commented 4 months ago

See my working config here: https://github.com/mashb1t/Fooocus/discussions/19#discussioncomment-9284128

9er commented 4 months ago

That works! I have checked existing issues, PRs and branches, but not discussions :upside_down_face:

blckbx commented 4 months ago

Yeah, been tinkering with mashbit's fork and got it working on Ubuntu 24.04 this way. But I guess it depends on availability of python packages (pypi access especially from China) as he mentioned. Hint: Make a backup of requirements_versions.txt because it will be replaced on every update until this repo is updated to fix Python 3.12 dependencies.

mashb1t commented 4 months ago

Please check out the fixed versions of https://github.com/lllyasviel/Fooocus/pull/2927, as it's always better to pin versions, especially for security and / or bundling via zip file. Feedback would highly be appreciated.

blckbx commented 4 months ago

Please check out the fixed versions of #2927, as it's always better to pin versions, especially for security and / or bundling via zip file. Feedback would highly be appreciated.

This is not enough for Python 3.12. pip install -r requirements_versions.txt exits building package "pillow".

Building wheels for collected packages: Pillow
  Building wheel for Pillow (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Building wheel for Pillow (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [201 lines of output]
...
  ERROR: Failed building wheel for Pillow

Tested Pillow versions up till success. Min version required is 10.0.0

Long story short: With Pillow==10.0.0 #2927 also builds on Python 3.12.

cootshk commented 3 months ago

Will be fixed in #2927 - if you want to use it now, download the updated branch @ cootshk/Fooocus

ricperry commented 3 months ago

When I update the requirements_versions.txt with >= instead of == (except for gradio, leave that one ==), then I got it to work.

mashb1t commented 2 months ago

General support has been established, but see https://github.com/lllyasviel/Fooocus/pull/2927#issuecomment-2231101766