Python 3.13 support

This commit is contained in:
Disty0
2025-06-09 22:58:08 +03:00
parent 92d2379626
commit bd2d9d1677
6 changed files with 20 additions and 9 deletions
+13 -3
View File
@@ -513,7 +513,7 @@ def get_platform():
def check_python(supported_minors=[], experimental_minors=[], reason=None):
if supported_minors is None or len(supported_minors) == 0:
supported_minors = [9, 10, 11, 12]
experimental_minors = []
experimental_minors = [13]
t_start = time.time()
if args.quick:
return
@@ -1155,8 +1155,8 @@ def ensure_base_requirements():
def install_optional():
t_start = time.time()
log.info('Installing optional requirements...')
install('basicsr')
install('gfpgan')
install('git+https://github.com/Disty0/BasicSR@2b6a12c28e0c81bfb13b7e984144f0b0f5461484', 'basicsr')
install('git+https://github.com/Disty0/GFPGAN@09b1190eabbc77e5f15c61fa7c38a2064b403e20', 'gfpgan')
install('clean-fid')
install('pillow-jxl-plugin==1.3.3', ignore=True)
install('optimum-quanto==0.2.7', ignore=True)
@@ -1188,6 +1188,16 @@ def install_requirements():
pr.enable()
if args.skip_requirements and not args.requirements:
return
if int(sys.version_info.minor) >= 13:
install("audioop-lts")
# gcc 15 patch
backup_cmake_policy = os.environ.get("CMAKE_POLICY_VERSION_MINIMUM", None)
backup_cxxflags = os.environ.get("CXXFLAGS", None)
os.environ.setdefault("CMAKE_POLICY_VERSION_MINIMUM", "3.5")
os.environ.setdefault("CXXFLAGS", "-include cstdint")
install("git+https://github.com/google/sentencepiece#subdirectory=python", "sentencepiece")
os.environ.setdefault("CMAKE_POLICY_VERSION_MINIMUM", backup_cmake_policy)
os.environ.setdefault("CXXFLAGS", backup_cxxflags)
if not installed('diffusers', quiet=True): # diffusers are not installed, so run initial installation
global quick_allowed # pylint: disable=global-statement
quick_allowed = False
+2 -2
View File
@@ -72,8 +72,8 @@ def setup_model(dirname):
except Exception:
pass
try:
install('basicsr', quiet=True)
install('gfpgan', quiet=True)
install('git+https://github.com/Disty0/BasicSR@2b6a12c28e0c81bfb13b7e984144f0b0f5461484', 'basicsr')
install('git+https://github.com/Disty0/GFPGAN@09b1190eabbc77e5f15c61fa7c38a2064b403e20', 'gfpgan')
import gfpgan
import facexlib
import modules.detailer
+1 -1
View File
@@ -206,7 +206,7 @@ else:
if agent.gfx_version >= 0x1100 and os.environ.get("FLASH_ATTENTION_USE_TRITON_ROCM", "false").lower() != "true":
# use the navi_rotary_fix fork because the original doesn't support rotary_emb for transformers
# original: "git+https://github.com/ROCm/flash-attention@howiejay/navi_support"
default = "https://github.com/Disty0/flash-attention@navi_rotary_fix"
default = "git+https://github.com/Disty0/flash-attention@navi_rotary_fix"
return os.environ.get("FLASH_ATTENTION_PACKAGE", default)
is_wsl: bool = os.environ.get('WSL_DISTRO_NAME', 'unknown' if spawn('wslpath -w /') else None) is not None
+2 -1
View File
@@ -8,4 +8,5 @@ from .models import *
from .ops import *
from .train import *
from .utils import *
from .version import __gitsha__, __version__
__gitsha__ = '366a46c91d51923c56e09963dbc358bc61315408'
__version__ = '1.3.2'
@@ -1,5 +1,4 @@
import math
import lpips
import torch
from torch import autograd as autograd
from torch import nn as nn
@@ -260,6 +259,7 @@ class LPIPSLoss(nn.Module):
use_input_norm=True,
range_norm=False,):
super(LPIPSLoss, self).__init__()
import lpips
self.perceptual = lpips.LPIPS(net="vgg", spatial=False).eval()
self.loss_weight = loss_weight
self.use_input_norm = use_input_norm
+1 -1
View File
@@ -48,6 +48,7 @@ gradio==3.43.2
huggingface_hub==0.31.2
numexpr==2.10.2
numpy==1.26.4
pandas==2.3.0
numba==0.61.2
protobuf==4.25.3
pytorch_lightning==1.9.4
@@ -63,7 +64,6 @@ typing-extensions==4.12.2
# additional
blendmodes
scipy
pandas
torchdiffeq
dctorch
scikit-image