Closed altoiddealer closed 2 months ago
My primary UI's are Comfy & CLI. However, that being said, I just installed forge & will be looking into the issue you have encountered & see if I can replicate the error. Hopefully I'll be able to isolate the issue & fix it.
Was able to isolate the issue & correct it (I installed the exact same extensions you had & they now work even with sd-forge-udav2 installed). Here you go - sd-forge-udav2.
Beautiful! Nice jorb :)
Actually... this isn't working for me.
I snagged the .zip file, and unzipped it in my forge extensions folder.
C:\0_SD\stable-diffusion-webui-forge\extensions\sd-forge-udav2\(files)
All the extensions load up without any problems.
However, when I try actually using your extension on an image with all default values, I get this error:
Traceback (most recent call last):
File "C:\0_SD\stable-diffusion-webui-forge\modules_forge\patch_basic.py", line 17, in loader
result = original_loader(*args, **kwargs)
File "C:\0_SD\stable-diffusion-webui-forge\venv\lib\site-packages\safetensors\torch.py", line 308, in load_file
with safe_open(filename, framework="pt", device=device) as f:
safetensors_rust.SafetensorError: Error while deserializing header: MetadataIncompleteBuffer
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\0_SD\stable-diffusion-webui-forge\venv\lib\site-packages\gradio\routes.py", line 488, in run_predict
output = await app.get_blocks().process_api(
File "C:\0_SD\stable-diffusion-webui-forge\venv\lib\site-packages\gradio\blocks.py", line 1431, in process_api
result = await self.call_function(
File "C:\0_SD\stable-diffusion-webui-forge\venv\lib\site-packages\gradio\blocks.py", line 1103, in call_function
prediction = await anyio.to_thread.run_sync(
File "C:\0_SD\stable-diffusion-webui-forge\venv\lib\site-packages\anyio\to_thread.py", line 33, in run_sync
return await get_asynclib().run_sync_in_worker_thread(
File "C:\0_SD\stable-diffusion-webui-forge\venv\lib\site-packages\anyio\_backends\_asyncio.py", line 877, in run_sync_in_worker_thread
return await future
File "C:\0_SD\stable-diffusion-webui-forge\venv\lib\site-packages\anyio\_backends\_asyncio.py", line 807, in run
result = context.run(func, *args)
File "C:\0_SD\stable-diffusion-webui-forge\venv\lib\site-packages\gradio\utils.py", line 707, in wrapper
response = f(*args, **kwargs)
File "C:\0_SD\stable-diffusion-webui-forge\extensions\sd-forge-udav2\scripts\upgraded_depth_anything_v2.py", line 239, in on_submit_single
colourized_filenames, grey_depth_filename = process_image(image, colour_map_method, encoder, selection)
File "C:\0_SD\stable-diffusion-webui-forge\extensions\sd-forge-udav2\scripts\upgraded_depth_anything_v2.py", line 82, in process_image
model = load_model(encoder)
File "C:\0_SD\stable-diffusion-webui-forge\extensions\sd-forge-udav2\scripts\upgraded_depth_anything_v2.py", line 41, in load_model
state_dict = load_file(checkpoint_path)
File "C:\0_SD\stable-diffusion-webui-forge\modules_forge\patch_basic.py", line 33, in loader
raise ValueError(exp)
ValueError: Error while deserializing header: MetadataIncompleteBuffer
File corrupted: C:\0_SD\stable-diffusion-webui-forge\extensions\sd-forge-udav2\scripts\..\checkpoints\depth_anything_v2_vitl.safetensors
Forge has tried to move the corrupted file to C:\0_SD\stable-diffusion-webui-forge\extensions\sd-forge-udav2\scripts\..\checkpoints\depth_anything_v2_vitl.safetensors.corrupted
You may try again now and Forge will download models again.
If I try again, it yields:
Model loaded in 16.0s (load weights from disk: 0.7s, forge solving config: 0.1s, forge load real models: 14.2s, load textual inversion embeddings: 0.1s, calculate empty prompt: 0.8s).
Traceback (most recent call last):
File "C:\0_SD\stable-diffusion-webui-forge\venv\lib\site-packages\gradio\routes.py", line 488, in run_predict
output = await app.get_blocks().process_api(
File "C:\0_SD\stable-diffusion-webui-forge\venv\lib\site-packages\gradio\blocks.py", line 1431, in process_api
result = await self.call_function(
File "C:\0_SD\stable-diffusion-webui-forge\venv\lib\site-packages\gradio\blocks.py", line 1103, in call_function
prediction = await anyio.to_thread.run_sync(
File "C:\0_SD\stable-diffusion-webui-forge\venv\lib\site-packages\anyio\to_thread.py", line 33, in run_sync
return await get_asynclib().run_sync_in_worker_thread(
File "C:\0_SD\stable-diffusion-webui-forge\venv\lib\site-packages\anyio\_backends\_asyncio.py", line 877, in run_sync_in_worker_thread
return await future
File "C:\0_SD\stable-diffusion-webui-forge\venv\lib\site-packages\anyio\_backends\_asyncio.py", line 807, in run
result = context.run(func, *args)
File "C:\0_SD\stable-diffusion-webui-forge\venv\lib\site-packages\gradio\utils.py", line 707, in wrapper
response = f(*args, **kwargs)
File "C:\0_SD\stable-diffusion-webui-forge\extensions\sd-forge-udav2\scripts\upgraded_depth_anything_v2.py", line 239, in on_submit_single
colourized_filenames, grey_depth_filename = process_image(image, colour_map_method, encoder, selection)
File "C:\0_SD\stable-diffusion-webui-forge\extensions\sd-forge-udav2\scripts\upgraded_depth_anything_v2.py", line 82, in process_image
model = load_model(encoder)
File "C:\0_SD\stable-diffusion-webui-forge\extensions\sd-forge-udav2\scripts\upgraded_depth_anything_v2.py", line 38, in load_model
raise FileNotFoundError(f"Checkpoint file not found: {checkpoint_path}")
FileNotFoundError: Checkpoint file not found: C:\0_SD\stable-diffusion-webui-forge\extensions\sd-forge-udav2\scripts\..\checkpoints\depth_anything_v2_vitl.safetensors
When I go to the checkpoints directory, here is a list of the files:
depth_anything_v2_vitb.safetensors
depth_anything_v2_vitl.safetensors.corrupted
depth_anything_v2_vits.safetensors
Sorry, but now I see what the problem was.
The first time I launched Forge after adding the package to my extensions directory, it got this far in the CMD window and then froze:
venv "C:\0_SD\stable-diffusion-webui-forge\venv\Scripts\Python.exe"
Python 3.10.9 (tags/v3.10.9:1dd9be6, Dec 6 2022, 20:01:21) [MSC v.1934 64 bit (AMD64)]
Version: f0.0.17v1.8.0rc-latest-276-g29be1da7
Commit hash: 29be1da7cf2b5dccfc70fbdd33eb35c56a31ffb7
I waited about 30 seconds, and figured it got stuck or something, so I closed the window.
I tried again, and again it froze except this time I waited patiently to see if it would finally load, and alas it finally did.
Now, this is when I received the errors in my previous comment.
...and now, I just launched Forge again from scratch, and since I had the checkpoints/
directory open, I noticed that it began creating the new checkpoint. So I see that the issue was that it did not finish download the checkpoint the first time (it is working now)
I recommend adding some sort of print statement or something, to advise that the checkpoints are downloading and not to close the window.
I've tried to add a print function but it didn't work & I didn't have the time to figure out a workaround, now that I'm on vacation I'll try again now that I've got a lot more time! I'll add it into the README.md so people know, so you are not the first to run into this & think something is wrong. (It usually takes between 45-90 secs the first time you launch the webui after installing the extension)
Just added it to README.md -
I want to make one more comment...
If I visit your repo and go straight to the Releases page, the description makes it sound like your extension is designed exclusively for SD WebUI Forge - it is not worded in a way that says "this is a Forge-specific package which is separate from the "normal" install method described in the main Readme"
LASTLY! (Sorry for all this)
For both A1111 and Forge... I can't remember if I changed this personally, or if it is default...
All my output images save to root folder output
(not outputs
).
So when your extension runs, it creates a new folder called outputs
I noticed that a1111 & forge main output_dir's were labeled differently (about an hour after I released the package, thought it was irritating, so I went & updated the code for sd-forge-udav2 [then swapped out the .7z & .zip in the release w/ the updated version]).
That being said, sd-webui-udav2 just got accepted into the main index.json today. w-e-w one of the maintainers of the a1111 extension index helped push some commits (that I approved & merged to main) which consolidated & improved the code before it got approved for the masses. The most important improvement being the checkpoints download function has been moved from the install.py to the main script, now the user doesn't experience a prolonged launch!
I will be updating the forge extension to the same specs, but optimized to prevent conflicts w/ other extensions in forge & w/ the output_dir set to output
. Once I've made the necessary updates, I'll add it to the release page here, & in addition I'll be creating a new repo called sd-forge-webui which I'll push to be included in the extension index.json as well, so any user can install either extension directly in a1111 or forge depending on which they are using! Appreciate all the feedback & help you've provided for troubleshooting/debugging 👍🏼
I want to make one more comment...
If I visit your repo and go straight to the Releases page, the description makes it sound like your extension is designed exclusively for SD WebUI Forge - it is not worded in a way that says "this is a Forge-specific package which is separate from the "normal" install method described in the main Readme"
Also it is stated here in the release page "This extension is STRICTLY for stable-diffusion-webui-forge to prevent any conflicts w/ pre-existing extensions you've installed." though not in the main README.md as you said. However, once I make the changes I specified above it won't be an issue.
Sounds good!
However, Forge is basically coasting along... the main dev (lllyasviel) is required to authorize anything and everything, and they are not bothered at all. He popped on a few weeks ago and merged one PR, first one in months. Doubt extensions index will ever be updated.
Very true, but I'm still going to submit the pull request. Btw I'll send you a message here when I've made the updates so you can install the polished version!
Hello, thanks for expanding this to be compatible with A1111.
I've installed this as an extension in both A1111 and Forge.
I'm reporting that it works in both.
However, it seems to cause issues with most of the extensions I have installed when using it with Forge. Forge is also quite popular, so I'm hoping that you may take a look at resolving this for Forge...
With your extension disabled, the following errors do not appear on startup: