XLabs-AI / deforum-x-flux

Deforum based on flux-dev by XLabs-AI
155 stars 9 forks source link

run.py on Windows very slow #2

Open SoftologyPro opened 3 weeks ago

SoftologyPro commented 3 weeks ago

Trying to get this running under Windows

Starting from an empty directory...

git clone https://github.com/XLabs-AI/deforum-x-flux
cd deforum-x-flux
python -m venv venv
call venv\scripts\activate.bat
python -m pip install --upgrade pip

At this point Windows users need to remove triton from requirements.txt or the triton failure causes the next line to not finish

pip install -r requirements.txt

Then I try

python run.py

Error

ModuleNotFoundError: No module named 'IPython'

Fix that with

pip install ipython
python run.py

Error

ModuleNotFoundError: No module named 'pandas'

Fix that with

pip install pandas
python run.py

Error

ModuleNotFoundError: No module named 'src.flux'

Can ipython and pandas be added to requirements.txt and whatever fix needs to get the src path working?

melMass commented 3 weeks ago

Try updating the nodes. This line adds the proper things to path so it should work fine, you might. have cloned it before it was added: https://github.com/XLabs-AI/deforum-x-flux/blob/c7e5caefb061a93fc55e121f8d317d6805803870/run.py#L24

SoftologyPro commented 3 weeks ago

Updating the nodes? This is for Windows, command line, outside any other system.

To make it reproducable, here is a batch file that can be saved into any empty directory and run to do the install. It creates a new directory and virtual env for it.

@echo off
echo *** Deleting deforum-x-flux directory if it exists
if exist deforum-x-flux\. rd /S /Q deforum-x-flux

echo *** Cloning deforum-x-flux repository
git clone https://github.com/XLabs-AI/deforum-x-flux
cd deforum-x-flux

echo *** Creating venv
python -m venv venv
call venv\scripts\activate.bat

echo *** Upgrading pip
python -m pip install --upgrade pip

echo *** Removing triton from requirements
findstr /V "triton" requirements.txt > requirements_patched.txt
del requirements.txt
ren requirements_patched.txt requirements.txt

echo *** Installing requirements
pip install -r requirements.txt

echo *** Installing packages missing from requirements.txt
pip install ipython
pip install pandas

call venv\scripts\deactivate.bat
cd..

pause

That clones the latest and installs all the requirements (including patching in the missing ipython and pandas).

When that finishes I cd into the deforum-x-flux directory and run

venv\scripts\activate.bat
python run.py

That complains

D:\Tests\Deforum-X-Flux\deforum-x-flux>venv\scripts\activate.bat

(venv) D:\Tests\Deforum-X-Flux\deforum-x-flux>python run.py
Traceback (most recent call last):
  File "D:\Tests\Deforum-X-Flux\deforum-x-flux\run.py", line 32, in <module>
    from helpers.render import render_animation, render_input_video, render_image_batch, render_interpolation
  File "D:\Tests\Deforum-X-Flux\deforum-x-flux\./deforum_flux\helpers\render.py", line 15, in <module>
    from .generate import generate, add_noise
  File "D:\Tests\Deforum-X-Flux\deforum-x-flux\./deforum_flux\helpers\generate.py", line 30, in <module>
    from src.flux.sampling import (
ModuleNotFoundError: No module named 'src.flux'

(venv) D:\Tests\Deforum-X-Flux\deforum-x-flux>

If I look in run.py there is the sys.path.append line, but still it complains about the missing module?

melMass commented 3 weeks ago

Yeah you are not following the readme. You need to do a recursive clone: https://github.com/XLabs-AI/deforum-x-flux?tab=readme-ov-file#clone-repository

PS: also I don't recommend doing that in your bat it would repeat each time you launch which is probably not what you want

SoftologyPro commented 3 weeks ago

Thank you! That was the problem. I changed the git clone to the recursive one in the readme. Once that install finishes, I run

cd deforum-x-flux
venv\scripts\activate
python run.py

complains

ModuleNotFoundError: No module named 'matplotlib'

pip install matplotlib, then python run.py

ModuleNotFoundError: No module named 'skimage'

pip install scikit-image, then python run.py

and it works! :) At least it is at frame 1 of 1000. Going to take a long time. How long should I expect each frame to take to render on a 4090?

So here is the full working batch file for anyone who wants to install this easily in Windows.

@echo off
echo *** Deleting deforum-x-flux directory if it exists
if exist deforum-x-flux\. rd /S /Q deforum-x-flux

echo *** Cloning deforum-x-flux repository
git clone --recurse-submodules https://github.com/XLabs-AI/deforum-x-flux.git
cd deforum-x-flux

echo *** Creating venv
python -m venv venv
call venv\scripts\activate.bat

echo *** Upgrading pip
python -m pip install --upgrade pip

echo *** Removing triton from requirements
findstr /V "triton" requirements.txt > requirements_patched.txt
del requirements.txt
ren requirements_patched.txt requirements.txt

echo *** Installing requirements
pip install -r requirements.txt

echo *** Installing packages missing from requirements.txt
pip install ipython
pip install pandas
pip install matplotlib
pip install scikit-image

echo *** Installing GPU torch
pip uninstall -y torch
pip install --no-cache-dir --ignore-installed --force-reinstall --no-warn-conflicts torch==2.4.0+cu118 torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118

call venv\scripts\deactivate.bat
cd..

pause

Also, yes, that batch is only for the initial install, not running every time once installed. Once installed it will be activate the venv then python run.py.

melMass commented 3 weeks ago

Nice! I thought you were using ComfyUI hence the "nodes" mention. I've been commenting on 2 distinct xlabs repo and got confused, this one is notebook based for now, and I haven't tested it myself yet. Regarding speed you should try the Schnell variant it should drastically speed up the inference, there are also massive fp8 optimizations in latest PyTorch for 4000 series

SoftologyPro commented 3 weeks ago

OK, using the current defaults in run.py it got to Rendering animation frame 1 of 1000 and is sat there now at almost 100% GPU (4090 24GB) for 26 minutes with no sign of frame 2 yet. Pytorch is at the latest 4.2.0.

image

Which schnell model should I use? flux-schnell-fp8 gives a key error.

SoftologyPro commented 3 weeks ago

I can change the first flux-dev to flux-schnell in run.py, ie

image

But what do I need to change the flux-dev-fp8 to?

It seems to be as slow as dev (at least it has been going 5 minutes for frame 1)

And does "notebook based for now" mean it is not supposed to be possible running locally on a 24GB 4090? If so I can give up for now.

stazizov commented 2 weeks ago

load any quantized schnell weights if you want, I haven't tried to run this on schell

SoftologyPro commented 2 weeks ago

load any quantized schnell weights if you want, I haven't tried to run this on schell

Should this be possible to run (using dev) on a 24GB 4090 locally? Or does it need more VRAM or a pro class GPU?

Could you possibly give me the edits to the run.py to test schnell models?

stazizov commented 2 weeks ago

It's runs on iterative img2img usage of flux, if you can run flux-dev on your machine, then you are able to use deforum

SoftologyPro commented 2 weeks ago

Ok. I give the automated setup batch file above to install it. But when it runs it never seems to end and takes 100% GPU for a long time. Can you try it on a Windows PC and let me know if run.py is even supposed to run on Windows? That is without any edits to run.py. If run.py does need edits please help.

stazizov commented 2 weeks ago

Got it, We will try to debug on windows, i apologise for this missing

SoftologyPro commented 2 weeks ago

OK, thanks. I just did another clean test install (using the batch file above). This time I let it run to see if the frames would eventually be created, and they were. 29 minutes per frame. So, it is working, just excruciatingly slow. At this rate the full movie would take over 20 days to complete.

stazizov commented 2 weeks ago

OK, thanks. I just did another clean test install (using the batch file above). This time I let it run to see if the frames would eventually be created, and they were. 29 minutes per frame. So, it is working, just excruciatingly slow. At this rate the full movie would take over 20 days to complete.

something gone wrong, please checkout if cuda is visible, one frame cannot take too much time, and please specify what gpu are you using

SoftologyPro commented 2 weeks ago

GPU is a 4090. You can see from the screenshot I posted above it is using GPU and not CPU. I am running a lot of other AI/ML systems locally and they see CUDA and the GPU fine. Including the older Deforum scripts up to v0.7. Can you (or anyone on Windows) test this on a Windows PC and confirm the issue? Save the following into any empty directory as install.bat

@echo off
echo *** Deleting deforum-x-flux directory if it exists
if exist deforum-x-flux\. rd /S /Q deforum-x-flux

echo *** Cloning deforum-x-flux repository
git clone --recurse-submodules https://github.com/XLabs-AI/deforum-x-flux.git
cd deforum-x-flux

echo *** Creating venv
python -m venv venv
call venv\scripts\activate.bat

echo *** Upgrading pip
python -m pip install --upgrade pip

echo *** Removing triton from requirements
findstr /V "triton" requirements.txt > requirements_patched.txt
del requirements.txt
ren requirements_patched.txt requirements.txt

echo *** Installing requirements
pip install -r requirements.txt

echo *** Installing packages missing from requirements.txt
pip install ipython
pip install pandas
pip install matplotlib
pip install scikit-image

echo *** Installing GPU torch
pip uninstall -y torch
pip uninstall -y torch
pip uninstall -y torch
pip install --no-cache-dir --ignore-installed --force-reinstall --no-warn-conflicts torch==2.4.0+cu118 torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118

call venv\scripts\deactivate.bat
cd..

pause

Save the following into the same directory as run.bat.

@echo off
cls
cd deforum-x-flux
call venv\scripts\activate.bat
python run.py
call venv\scripts\deactivate.bat
cd..

Command prompt into the folder and run install.bat then run.bat You will see the issue. The only change I make to the install is remove triton (not compatible with Windows) and install the packages not included with requirements.txt that are needed for run.py to start. I tried updating torch to 2.4.0 CUDA 12.1 but that made no difference.

stazizov commented 2 weeks ago

do you use fp8 version? on H100 4 seconds 24 fps 1024x1024 takes 4 minutes, yes this is slow, but it works

SoftologyPro commented 2 weeks ago

I am using whatever version is in run.py. I am not making any edits there after the clone/install. 4 minutes per frame? Is that on Windows using my install batch file? Hopefully I don't need an H100 for this as they go for between $60k and $65k here :) If you could give me the edits needed for fp8 in run.py I could test that here.

stazizov commented 2 weeks ago

I will try to debug on 4090 windows machine today

SoftologyPro commented 2 weeks ago

I just tried the same install and run batch files on another PC with a 24GB 3090 and Windows 10. This time the frames took 2 hours 47 minutes each!

SoftologyPro commented 2 weeks ago

I will try to debug on 4090 windows machine today

Any update on this? I really want to be able to use this on Windows (and add support for it to Visions of Chaos as I have had requests from users to include it).

SoftologyPro commented 1 week ago

Here is a pip list in case that helps...

Package             Version
------------------- ------------
accelerate          0.33.0
aiohappyeyeballs    2.4.0
aiohttp             3.10.5
aiosignal           1.3.1
annotated-types     0.7.0
asttokens           2.4.1
async-timeout       4.0.3
attrs               24.2.0
certifi             2024.8.30
charset-normalizer  3.3.2
colorama            0.4.6
coloredlogs         15.0.1
contourpy           1.3.0
cycler              0.12.1
decorator           5.1.1
einops              0.8.0
exceptiongroup      1.2.2
executing           2.0.1
filelock            3.13.1
flatbuffers         24.3.25
fonttools           4.53.1
frozenlist          1.4.1
fsspec              2024.2.0
huggingface-hub     0.24.6
humanfriendly       10.0
idna                3.8
imageio             2.35.1
ipython             8.27.0
jedi                0.19.1
Jinja2              3.1.3
kiwisolver          1.4.5
lazy_loader         0.4
lightning-utilities 0.11.6
MarkupSafe          2.1.5
matplotlib          3.9.2
matplotlib-inline   0.1.7
mpmath              1.3.0
multidict           6.0.5
networkx            3.2.1
ninja               1.11.1.1
numexpr             2.10.1
numpngw             0.1.4
numpy               1.26.3
onnxruntime         1.19.0
opencv-python       4.10.0.84
optimum-quanto      0.2.4
packaging           24.1
pandas              2.2.2
parso               0.8.4
pillow              10.2.0
pip                 24.2
prompt_toolkit      3.0.47
protobuf            5.28.0
psutil              6.0.0
pure_eval           0.2.3
pydantic            2.8.2
pydantic_core       2.20.1
Pygments            2.18.0
pyparsing           3.1.4
pyreadline3         3.4.1
python-dateutil     2.9.0.post0
pytorch-lightning   2.4.0
pytz                2024.1
PyYAML              6.0.2
regex               2024.7.24
requests            2.32.3
safetensors         0.4.4
scikit-image        0.24.0
scipy               1.14.1
sentencepiece       0.2.0
setuptools          65.5.0
six                 1.16.0
stack-data          0.6.3
sympy               1.12
tifffile            2024.8.28
timm                1.0.9
tokenizers          0.19.1
torch               2.4.0+cu118
torchaudio          2.4.0+cu118
torchmetrics        1.4.1
torchvision         0.19.0+cu118
tqdm                4.66.5
traitlets           5.14.3
transformers        4.44.2
typing_extensions   4.12.2
tzdata              2024.1
urllib3             2.2.2
wcwidth             0.2.13
xgboost             2.1.1
yarl                1.9.4
stazizov commented 1 week ago

Visions of Chaos

and you could finally run it on windows?

SoftologyPro commented 1 week ago

Visions of Chaos

and you could finally run it on windows?

No, the batch files above are still very slow. If you can help work out why it is so slow and speed it up I will be able to add it to Visions of Chaos.

SoftologyPro commented 1 week ago

Just in case this may help, here are the full stats. At the end of these stats is where it is grinding away at around 100% GPU rendering the next frame very slowly.

No real errors, just a bunch of warnings about data types.

Loading checkpoint shards: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00,  9.41it/s]
D:\Tests\Deforum-X-Flux\deforum-x-flux\venv\lib\site-packages\transformers\tokenization_utils_base.py:1601: FutureWarning: `clean_up_tokenization_spaces` was not set. It will be set to `True` by default. This behavior will be depracted in transformers v4.45, and will be then set to `False` by default. For more details check this issue: https://github.com/huggingface/transformers/issues/31884
  warnings.warn(
Init model
Loading checkpoint
Start a quantization process...
Model is quantized!
Init AE
D:\Tests\Deforum-X-Flux\deforum-x-flux\./deforum_flux\helpers\animation.py:314: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise an error in a future version of pandas. Value '0' has dtype incompatible with float64, please explicitly cast to a compatible dtype first.
  key_frame_series[i] = value
D:\Tests\Deforum-X-Flux\deforum-x-flux\./deforum_flux\helpers\animation.py:314: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise an error in a future version of pandas. Value '1.04' has dtype incompatible with float64, please explicitly cast to a compatible dtype first.
  key_frame_series[i] = value
D:\Tests\Deforum-X-Flux\deforum-x-flux\./deforum_flux\helpers\animation.py:314: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise an error in a future version of pandas. Value '0' has dtype incompatible with float64, please explicitly cast to a compatible dtype first.
  key_frame_series[i] = value
D:\Tests\Deforum-X-Flux\deforum-x-flux\./deforum_flux\helpers\animation.py:314: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise an error in a future version of pandas. Value '0' has dtype incompatible with float64, please explicitly cast to a compatible dtype first.
  key_frame_series[i] = value
D:\Tests\Deforum-X-Flux\deforum-x-flux\./deforum_flux\helpers\animation.py:314: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise an error in a future version of pandas. Value '7.5' has dtype incompatible with float64, please explicitly cast to a compatible dtype first.
  key_frame_series[i] = value
D:\Tests\Deforum-X-Flux\deforum-x-flux\./deforum_flux\helpers\animation.py:314: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise an error in a future version of pandas. Value '0' has dtype incompatible with float64, please explicitly cast to a compatible dtype first.
  key_frame_series[i] = value
D:\Tests\Deforum-X-Flux\deforum-x-flux\./deforum_flux\helpers\animation.py:314: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise an error in a future version of pandas. Value '0' has dtype incompatible with float64, please explicitly cast to a compatible dtype first.
  key_frame_series[i] = value
D:\Tests\Deforum-X-Flux\deforum-x-flux\./deforum_flux\helpers\animation.py:314: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise an error in a future version of pandas. Value '0' has dtype incompatible with float64, please explicitly cast to a compatible dtype first.
  key_frame_series[i] = value
D:\Tests\Deforum-X-Flux\deforum-x-flux\./deforum_flux\helpers\animation.py:314: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise an error in a future version of pandas. Value '0' has dtype incompatible with float64, please explicitly cast to a compatible dtype first.
  key_frame_series[i] = value
D:\Tests\Deforum-X-Flux\deforum-x-flux\./deforum_flux\helpers\animation.py:314: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise an error in a future version of pandas. Value '0' has dtype incompatible with float64, please explicitly cast to a compatible dtype first.
  key_frame_series[i] = value
D:\Tests\Deforum-X-Flux\deforum-x-flux\./deforum_flux\helpers\animation.py:314: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise an error in a future version of pandas. Value '53' has dtype incompatible with float64, please explicitly cast to a compatible dtype first.
  key_frame_series[i] = value
D:\Tests\Deforum-X-Flux\deforum-x-flux\./deforum_flux\helpers\animation.py:314: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise an error in a future version of pandas. Value '0.02' has dtype incompatible with float64, please explicitly cast to a compatible dtype first.
  key_frame_series[i] = value
D:\Tests\Deforum-X-Flux\deforum-x-flux\./deforum_flux\helpers\animation.py:314: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise an error in a future version of pandas. Value '0.65' has dtype incompatible with float64, please explicitly cast to a compatible dtype first.
  key_frame_series[i] = value
D:\Tests\Deforum-X-Flux\deforum-x-flux\./deforum_flux\helpers\animation.py:314: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise an error in a future version of pandas. Value '1.0' has dtype incompatible with float64, please explicitly cast to a compatible dtype first.
  key_frame_series[i] = value
D:\Tests\Deforum-X-Flux\deforum-x-flux\./deforum_flux\helpers\animation.py:322: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise an error in a future version of pandas. Value 'Default Flux Scheduler' has dtype incompatible with float64, please explicitly cast to a compatible dtype first.
  key_frame_series[i] = numexpr.evaluate(value) if not is_single_string else value # workaround for values formatted like 0:("I am test") //used for sampler schedules
D:\Tests\Deforum-X-Flux\deforum-x-flux\./deforum_flux\helpers\animation.py:332: FutureWarning: Series.interpolate with object dtype is deprecated and will raise in a future version. Call obj.infer_objects(copy=False) before interpolating instead.
  key_frame_series = key_frame_series.interpolate(method=interp_method.lower(), limit_direction='both')
D:\Tests\Deforum-X-Flux\deforum-x-flux\./deforum_flux\helpers\animation.py:314: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise an error in a future version of pandas. Value '5' has dtype incompatible with float64, please explicitly cast to a compatible dtype first.
  key_frame_series[i] = value
D:\Tests\Deforum-X-Flux\deforum-x-flux\./deforum_flux\helpers\animation.py:314: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise an error in a future version of pandas. Value '1.0' has dtype incompatible with float64, please explicitly cast to a compatible dtype first.
  key_frame_series[i] = value
D:\Tests\Deforum-X-Flux\deforum-x-flux\./deforum_flux\helpers\animation.py:314: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise an error in a future version of pandas. Value '0.2' has dtype incompatible with float64, please explicitly cast to a compatible dtype first.
  key_frame_series[i] = value
D:\Tests\Deforum-X-Flux\deforum-x-flux\./deforum_flux\helpers\animation.py:314: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise an error in a future version of pandas. Value '0.0' has dtype incompatible with float64, please explicitly cast to a compatible dtype first.
  key_frame_series[i] = value
D:\Tests\Deforum-X-Flux\deforum-x-flux\./deforum_flux\helpers\animation.py:314: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise an error in a future version of pandas. Value '1' has dtype incompatible with float64, please explicitly cast to a compatible dtype first.
  key_frame_series[i] = value
D:\Tests\Deforum-X-Flux\deforum-x-flux\./deforum_flux\helpers\animation.py:314: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise an error in a future version of pandas. Value '0.5' has dtype incompatible with float64, please explicitly cast to a compatible dtype first.
  key_frame_series[i] = value
D:\Tests\Deforum-X-Flux\deforum-x-flux\./deforum_flux\helpers\animation.py:314: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise an error in a future version of pandas. Value '1' has dtype incompatible with float64, please explicitly cast to a compatible dtype first.
  key_frame_series[i] = value
D:\Tests\Deforum-X-Flux\deforum-x-flux\./deforum_flux\helpers\animation.py:314: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise an error in a future version of pandas. Value '100' has dtype incompatible with float64, please explicitly cast to a compatible dtype first.
  key_frame_series[i] = value
D:\Tests\Deforum-X-Flux\deforum-x-flux\./deforum_flux\helpers\animation.py:314: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise an error in a future version of pandas. Value '0' has dtype incompatible with float64, please explicitly cast to a compatible dtype first.
  key_frame_series[i] = value
Saving animation frames to outputs\2024-08\StableFun
D:\Tests\Deforum-X-Flux\deforum-x-flux\./deforum_flux\helpers\render.py:236: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise an error in a future version of pandas. Value 'super realism, 4k, a highly detailed close-up view of a woman's mesmerizing blue eye, with realistic reflections and an intense natural sparkle. The iris displays intricate patterns of deep blues and subtle hints of lighter hues, while delicate veins add to the eye's natural complexity. Soft, diffused lighting enhances the eye's depth, with a blurred background to emphasize the eye's captivating beauty and detail.' has dtype incompatible with float64, please explicitly cast to a compatible dtype first.
  cond_prompt_series[int(i)] = prompt
D:\Tests\Deforum-X-Flux\deforum-x-flux\./deforum_flux\helpers\render.py:242: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise an error in a future version of pandas. Value 'wtf, bad image, corrupted image, deformed' has dtype incompatible with float64, please explicitly cast to a compatible dtype first.
  uncond_prompt_series[int(i)] = prompt
Rendering animation frame 0 of 1000
seed: 247141167
cond_prompt: super realism, 4k, a highly detailed close-up view of a woman's mesmerizing blue eye, with realistic reflections and an intense natural sparkle. The iris displays intricate patterns of deep blues and subtle hints of lighter hues, while delicate veins add to the eye's natural complexity. Soft, diffused lighting enhances the eye's depth, with a blurred background to emphasize the eye's captivating beauty and detail.
uncond_prompt: wtf, bad image, corrupted image, deformed
Sampler: Flux Default Sampler
Angle: 0.0 Zoom: 1.04
Tx: 0.0 Ty: 0.0 Tz: 7.5
Rx: 0.0 Ry: 0.0 Rz: 0.0
noise:  0.02
Strength:  0.65
Contrast:  1.0
Kernel:  5
Sigma:  1.0
Amount:  0.2
Threshold:  0.0
Seed set to 247141167
<PIL.Image.Image image mode=RGB size=1024x1024 at 0x1BB0288B730>
Rendering animation frame 1 of 1000
seed: 247141168
cond_prompt: super realism, 4k, a highly detailed close-up view of a woman's mesmerizing blue eye, with realistic reflections and an intense natural sparkle. The iris displays intricate patterns of deep blues and subtle hints of lighter hues, while delicate veins add to the eye's natural complexity. Soft, diffused lighting enhances the eye's depth, with a blurred background to emphasize the eye's captivating beauty and detail.
uncond_prompt: wtf, bad image, corrupted image, deformed
Sampler: Flux Default Sampler
Angle: 0.0 Zoom: 1.04
Tx: 0.0 Ty: 0.0 Tz: 7.5
Rx: 0.0 Ry: 0.0 Rz: 0.0
noise:  0.02
Strength:  0.6541666666666667
Contrast:  1.0
Kernel:  5
Sigma:  1.0
Amount:  0.2
Threshold:  0.0
Seed set to 247141168

I even tried the latest nightly torch 2.5.0 as I needed that to get the fp8 version of flux working pip install torch==2.5.0.dev20240828+cu124 torchvision --index-url https://download.pytorch.org/whl/nightly/cu124 but that made no difference here.

moebiussurfing commented 1 week ago

hey @SoftologyPro , I am also trying to make it work on Windows. I needed to do some of your workarounds too, but I am stuck at torch.cuda is not available... https://github.com/XLabs-AI/deforum-x-flux/issues/6#issuecomment-2322813221 any help?

SoftologyPro commented 1 week ago

hey @SoftologyPro , I am also trying to make it work on Windows. I needed to do some of your workarounds too, but I am stuck at torch.cuda is not available... #6 (comment) any help?

Use the batch files in this post https://github.com/XLabs-AI/deforum-x-flux/issues/2#issuecomment-2311827181 That covers all the requirements and you will see it handles the CUDA torch install too. Let me know if it works, but is super slow for you. That is my issue now. It installs OK, it runs OK, just very slow.

moebiussurfing commented 1 week ago

BTW, I forgot to check/install cuda_11.8.0_522.06_windows.exe.

Thanks, I ran your install.bat and it seems to work. Then run.bat script. It seems stuck on logging huggingface. Should need to put the token somewhere... I added an .env/txt file with the token at the root path but not worked:

Loading checkpoint shards: 100%|█████████████████████████████████████████████████████████| 2/2 [00:00<00:00,  6.76it/s]
D:\_AI\ComfyUI_windows_portable\ComfyUI\custom_nodes\deforum-x-flux\deforum-x-flux\venv\lib\site-packages\transformers\tokenization_utils_base.py:1601: FutureWarning: `clean_up_tokenization_spaces` was not set. It will be set to `True` by default. This behavior will be depracted in transformers v4.45, and will be then set to `False` by default. For more details check this issue: https://github.com/huggingface/transformers/issues/31884
  warnings.warn(
Init model
Loading checkpoint
Start a quantization process...
Model is quantized!
Traceback (most recent call last):
  File "D:\_AI\ComfyUI_windows_portable\ComfyUI\custom_nodes\deforum-x-flux\deforum-x-flux\venv\lib\site-packages\huggingface_hub\utils\_errors.py", line 304, in hf_raise_for_status
    response.raise_for_status()
  File "D:\_AI\ComfyUI_windows_portable\ComfyUI\custom_nodes\deforum-x-flux\deforum-x-flux\venv\lib\site-packages\requests\models.py", line 1024, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 401 Client Error: Unauthorized for url: https://huggingface.co/black-forest-labs/FLUX.1-dev/resolve/main/ae.safetensors

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "D:\_AI\ComfyUI_windows_portable\ComfyUI\custom_nodes\deforum-x-flux\deforum-x-flux\run.py", line 122, in <module>
    root.__dict__.update(ModelSetup())
  File "D:\_AI\ComfyUI_windows_portable\ComfyUI\custom_nodes\deforum-x-flux\deforum-x-flux\run.py", line 119, in ModelSetup
    model = Model("flux-dev-fp8", quantized=True)
  File "D:\_AI\ComfyUI_windows_portable\ComfyUI\custom_nodes\deforum-x-flux\deforum-x-flux\run.py", line 92, in __init__
    self.dit, self.ae, self.t5, self.clip = self.get_models(name, 'cuda', offload=False, is_schnell=False, quantized=quantized)
  File "D:\_AI\ComfyUI_windows_portable\ComfyUI\custom_nodes\deforum-x-flux\deforum-x-flux\run.py", line 101, in get_models
    ae = load_ae(name, device="cpu" if offload else device)
  File "D:\_AI\ComfyUI_windows_portable\ComfyUI\custom_nodes\deforum-x-flux\deforum-x-flux\./x-flux\src\flux\util.py", line 329, in load_ae
    ckpt_path = hf_hub_download(configs[name].repo_id_ae, configs[name].repo_ae)
  File "D:\_AI\ComfyUI_windows_portable\ComfyUI\custom_nodes\deforum-x-flux\deforum-x-flux\venv\lib\site-packages\huggingface_hub\utils\_deprecation.py", line 101, in inner_f
    return f(*args, **kwargs)
  File "D:\_AI\ComfyUI_windows_portable\ComfyUI\custom_nodes\deforum-x-flux\deforum-x-flux\venv\lib\site-packages\huggingface_hub\utils\_validators.py", line 114, in _inner_fn
    return fn(*args, **kwargs)
  File "D:\_AI\ComfyUI_windows_portable\ComfyUI\custom_nodes\deforum-x-flux\deforum-x-flux\venv\lib\site-packages\huggingface_hub\file_download.py", line 1240, in hf_hub_download
    return _hf_hub_download_to_cache_dir(
  File "D:\_AI\ComfyUI_windows_portable\ComfyUI\custom_nodes\deforum-x-flux\deforum-x-flux\venv\lib\site-packages\huggingface_hub\file_download.py", line 1347, in _hf_hub_download_to_cache_dir
    _raise_on_head_call_error(head_call_error, force_download, local_files_only)
  File "D:\_AI\ComfyUI_windows_portable\ComfyUI\custom_nodes\deforum-x-flux\deforum-x-flux\venv\lib\site-packages\huggingface_hub\file_download.py", line 1854, in _raise_on_head_call_error
    raise head_call_error
  File "D:\_AI\ComfyUI_windows_portable\ComfyUI\custom_nodes\deforum-x-flux\deforum-x-flux\venv\lib\site-packages\huggingface_hub\file_download.py", line 1751, in _get_metadata_or_catch_error
    metadata = get_hf_file_metadata(
  File "D:\_AI\ComfyUI_windows_portable\ComfyUI\custom_nodes\deforum-x-flux\deforum-x-flux\venv\lib\site-packages\huggingface_hub\utils\_validators.py", line 114, in _inner_fn
    return fn(*args, **kwargs)
  File "D:\_AI\ComfyUI_windows_portable\ComfyUI\custom_nodes\deforum-x-flux\deforum-x-flux\venv\lib\site-packages\huggingface_hub\file_download.py", line 1673, in get_hf_file_metadata
    r = _request_wrapper(
  File "D:\_AI\ComfyUI_windows_portable\ComfyUI\custom_nodes\deforum-x-flux\deforum-x-flux\venv\lib\site-packages\huggingface_hub\file_download.py", line 376, in _request_wrapper
    response = _request_wrapper(
  File "D:\_AI\ComfyUI_windows_portable\ComfyUI\custom_nodes\deforum-x-flux\deforum-x-flux\venv\lib\site-packages\huggingface_hub\file_download.py", line 400, in _request_wrapper
    hf_raise_for_status(response)
  File "D:\_AI\ComfyUI_windows_portable\ComfyUI\custom_nodes\deforum-x-flux\deforum-x-flux\venv\lib\site-packages\huggingface_hub\utils\_errors.py", line 321, in hf_raise_for_status
    raise GatedRepoError(message, response) from e
huggingface_hub.utils._errors.GatedRepoError: 401 Client Error. (Request ID: Root=1-66d33924-069017af6585401b70e9813a;9fd01092-1f9b-4440-8695-73b32992728f)

Cannot access gated repo for url https://huggingface.co/black-forest-labs/FLUX.1-dev/resolve/main/ae.safetensors.
Access to model black-forest-labs/FLUX.1-dev is restricted. You must be authenticated to access it.

EDIT: I tried to log in doing huggingface-cli login and solved this error.

moebiussurfing commented 1 week ago

OK, using the current defaults in run.py it got to Rendering animation frame 1 of 1000 and is sat there now at almost 100% GPU (4090 24GB) for 26 minutes with no sign of frame 2 yet. Pytorch is at the latest 4.2.0.

image

Which schnell model should I use? flux-schnell-fp8 gives a key error.

same here:

image

SoftologyPro commented 1 week ago

OK, thanks, that confirms the issue on WIndows. 2 of my PCs and another here. Hoping the dev(s) can have a look now and work out why it is so slow on Windows.

SoftologyPro commented 1 week ago

Visions of Chaos

and you could finally run it on windows?

Can you please help with this issue? Now confirmed on 3 different Windows PCs. The install batch file I provide above allows a single-click install to test on any Windows system. If the speed issue could be fixed I can add support for this in Visions of Chaos.