Closed TheFatBastid closed 7 months ago
we need SDXL OLive script to convert SDXL models; standard SD Olive scripts will not work with SDXL https://github.com/microsoft/Olive/tree/main/examples/directml/stable_diffusion_xl Automatic has to trigger this script when SDXL is used, may be we need a checkmark box saying we are trying to convert SDXL
we need SDXL OLive script to convert SDXL models; standard SD Olive scripts will not work with SDXL https://github.com/microsoft/Olive/tree/main/examples/directml/stable_diffusion_xl Automatic has to trigger this script when SDXL is used, may be we need a checkmark box saying we are trying to convert SDXL
Oh, nice find! I'm having same issue as OP as well. I believe @lshqqytiger is aware from the other Olive Support thread.
Please check if this issue persists after commit 953706bacf986eb573c7c44b40d8ff67a23e794c.
Unloaded weights 0.0s.
Optimizing text_encoder [2023-09-24 12:24:42,126] [INFO] [engine.py:939:_run_pass] Running pass OnnxConversion [2023-09-24 12:24:42,129] [INFO] [engine.py:939:_run_pass] Running pass OrtTransformersOptimization [2023-09-24 12:24:42,131] [INFO] [footprint.py:166:get_pareto_frontier] pareto frontier points: 1_OrtTransformersOptimization-0-039a5ccebc3e6aa42e8049eb12c97898 {'latency-avg': 7.93922} [2023-09-24 12:24:42,132] [INFO] [engine.py:609:get_pareto_frontier_footprints] Output all 1 models [2023-09-24 12:24:42,133] [INFO] [engine.py:392:run] No packaging config provided, skip packaging artifacts Optimized text_encoder
Optimizing text_encoder_2 [2023-09-24 12:24:42,149] [INFO] [engine.py:939:_run_pass] Running pass OnnxConversion [2023-09-24 12:24:42,151] [INFO] [engine.py:939:_run_pass] Running pass OrtTransformersOptimization [2023-09-24 12:24:42,154] [INFO] [footprint.py:166:get_pareto_frontier] pareto frontier points: 3_OrtTransformersOptimization-2-039a5ccebc3e6aa42e8049eb12c97898 {'latency-avg': 33.09119} [2023-09-24 12:24:42,154] [INFO] [engine.py:609:get_pareto_frontier_footprints] Output all 1 models [2023-09-24 12:24:42,155] [INFO] [engine.py:392:run] No packaging config provided, skip packaging artifacts Optimized text_encoder_2
Optimizing unet [2023-09-24 12:24:42,172] [INFO] [engine.py:939:_run_pass] Running pass OnnxConversion [2023-09-24 12:24:42,173] [WARNING] [engine.py:920:_run_passes] Skipping evaluation as model was pruned [2023-09-24 12:24:42,174] [INFO] [engine.py:609:get_pareto_frontier_footprints] Output all 0 models [2023-09-24 12:24:42,174] [INFO] [engine.py:392:run] No packaging config provided, skip packaging artifacts Error completing request Arguments: ('sd_xl_base_1.0.safetensors', '', 'vae', 'sdxl', 'sdxl', 'runwayml/stable-diffusion-v1-5', '', 'vae', 'stable-diffusion-v1-5', 'stable-diffusion-v1-5', True, True, True, True, True, True, True, True, True, True, 'euler', True, 1024, False, '', '', '') {} Traceback (most recent call last): File "C:\stable-diffusion-webui-directml\modules\call_queue.py", line 57, in f res = list(func(*args, *kwargs)) File "C:\stable-diffusion-webui-directml\modules\call_queue.py", line 36, in f res = func(args, **kwargs) File "C:\stable-diffusion-webui-directml\modules\ui.py", line 2081, in optimize return optimize_sdxl_from_ckpt( File "C:\stable-diffusion-webui-directml\modules\sd_olive_ui.py", line 149, in optimize_sdxl_from_ckpt optimize( File "C:\stable-diffusion-webui-directml\modules\sd_olive_ui.py", line 352, in optimize assert conversion_footprint and optimizer_footprint AssertionError
After running an update, the error I get now is as follows:
Unloaded weights 0.0s.
Optimizing text_encoder
[2023-09-28 18:48:00,973] [INFO] [footprint.py:168:get_pareto_frontier] pareto frontier points: 3_OrtTransformersOptimization-2-b57fe3a5dca0ab4244f22df067339eea-gpu-dml {'latency-avg': 7.15187}
[2023-09-28 18:48:00,973] [INFO] [engine.py:475:run_search] Output all 1 models
[2023-09-28 18:48:00,974] [INFO] [engine.py:318:run] No packaging config provided, skip packaging artifacts
Optimized text_encoder
Optimizing unet
[2023-09-28 18:48:00,995] [INFO] [footprint.py:168:get_pareto_frontier] pareto frontier points: 5_OrtTransformersOptimization-4-686c2f21a746dbcaaa43ee99073900e6-gpu-dml {'latency-avg': 52.05949}
[2023-09-28 18:48:00,995] [INFO] [engine.py:475:run_search] Output all 1 models
[2023-09-28 18:48:00,996] [INFO] [engine.py:318:run] No packaging config provided, skip packaging artifacts
Optimized unet
Optimizing vae_decoder
[2023-09-28 18:48:01,017] [INFO] [footprint.py:168:get_pareto_frontier] pareto frontier points: 7_OrtTransformersOptimization-6-b1a42f24996a64c47333128369a9eb21-gpu-dml {'latency-avg': 65.37038}
[2023-09-28 18:48:01,018] [INFO] [engine.py:475:run_search] Output all 1 models
[2023-09-28 18:48:01,018] [INFO] [engine.py:318:run] No packaging config provided, skip packaging artifacts
Optimized vae_decoder
Optimizing vae_encoder
[2023-09-28 18:48:01,041] [INFO] [footprint.py:168:get_pareto_frontier] pareto frontier points: 9_OrtTransformersOptimization-8-b1a42f24996a64c47333128369a9eb21-gpu-dml {'latency-avg': 35.96865}
[2023-09-28 18:48:01,042] [INFO] [engine.py:475:run_search] Output all 1 models
[2023-09-28 18:48:01,042] [INFO] [engine.py:318:run] No packaging config provided, skip packaging artifacts
Optimized vae_encoder
Creating ONNX pipeline...
*** Error completing request
*** Arguments: ('sd_xl_base_1.0_0.9vae.safetensors', '', 'vae', 'ONNX-SDXL', 'OUTPUT-SDXL', 'runwayml/stable-diffusion-v1-5', '', 'vae', 'stable-diffusion-v1-5', 'stable-diffusion-v1-5', True, False, True, True, True, True, True, True, True, True, 'euler', True, 1024, False, '', '', '') {}
Traceback (most recent call last):
File "G:\OLIVESD\stable-diffusion-webui-directml\modules\call_queue.py", line 57, in f
res = list(func(*args, **kwargs))
File "G:\OLIVESD\stable-diffusion-webui-directml\modules\call_queue.py", line 36, in f
res = func(*args, **kwargs)
File "G:\OLIVESD\stable-diffusion-webui-directml\modules\ui.py", line 2081, in optimize
return optimize_sdxl_from_ckpt(
File "G:\OLIVESD\stable-diffusion-webui-directml\modules\sd_olive_ui.py", line 149, in optimize_sdxl_from_ckpt
optimize(
File "G:\OLIVESD\stable-diffusion-webui-directml\modules\sd_olive_ui.py", line 405, in optimize
feature_extractor=pipeline.feature_extractor,
File "G:\OLIVESD\stable-diffusion-webui-directml\venv\lib\site-packages\diffusers\configuration_utils.py", line 137, in __getattr__
raise AttributeError(f"'{type(self).__name__}' object has no attribute '{name}'")
AttributeError: 'StableDiffusionXLPipeline' object has no attribute 'feature_extractor'
Settings I used Olive tab:
Getting AssertionError too. Tried optimize checkpoint and optimize onnx model , same error.
same here. I get 2 errors often. If I go and for instance download the ckpt file for SD 2-1 download, then try to optimize checkpoint under Olive Tab
Yes I turned safety checker off to try it, it did not work with it on or off.
Then if I try to get SDXL models to run, I go to ONNX tab - put in the SD model I want such as stabilityai/stable-diffusion-xl-base-1.0
click download model, that works ok.
Then move over to the olive tab using Optimize ONNX Model
It always fails optimizing UNet for me. If I deselect Unet it optimizes, but the model will not work without Unet.
I get this same assert error conversion_footprint and optimizer_footprint a lot.
It also seems, the options from the optimize checkpoint and optimize ONNX models are both taken into account when you click optimize model using olive, so if you put anything into the one, even though you are on another tab, they definitely get pulled in which if you are trying to optimize models and trying to find one which works, you can easily end up with weird things happening because it is using the values of both tabs when you hit optimize. As a user, I would not expect a tab I am not on to be influencing what I am doing on a different tab, but maybe that is just me and I don't understand it very well.
Is there an existing issue for this?
What happened?
I get the following when trying to convert an sdxl model using olive, regardless of what options are checked:
nloaded weights 0.0s. Error completing request Arguments: ('sd_xl_base_1.0.safetensors', '', 'vae', 'stable-diffusion-xl', 'stable-diffusion-xl', False, True, True, True, True, True, 'euler', True, 512, False, '', '', '') {} Traceback (most recent call last): File "C:\stable-diffusion-webui-directml\modules\call_queue.py", line 57, in f res = list(func(*args, *kwargs)) File "C:\stable-diffusion-webui-directml\modules\call_queue.py", line 36, in f res = func(args, **kwargs) File "C:\stable-diffusion-webui-directml\modules\sd_olive_ui.py", line 29, in optimize_from_ckpt pipeline = StableDiffusionPipeline.from_single_file(os.path.join(models_path, "Stable-diffusion", checkpoint), torch_dtype=torch.float32, requires_safety_checker=False, scheduler_type=scheduler_type) File "C:\stable-diffusion-webui-directml\venv\lib\site-packages\diffusers\loaders.py", line 1922, in from_single_file pipe = download_from_original_stable_diffusion_ckpt( File "C:\stable-diffusion-webui-directml\venv\lib\site-packages\diffusers\pipelines\stable_diffusion\convert_from_ckpt.py", line 1591, in download_from_original_stable_diffusion_ckpt pipe = pipeline_class( TypeError: StableDiffusionPipeline.init() got an unexpected keyword argument 'text_encoder_2'
Steps to reproduce the problem
What should have happened?
Convert the model
Sysinfo
sysinfo-2023-09-14-03-00.txt
What browsers do you use to access the UI ?
Brave
Console logs
Additional information
My windows username does have a space in it. Never know when that will cause problems.