Code Monkey home page Code Monkey logo

spensercai / sd-webui-deoldify Goto Github PK

View Code? Open in Web Editor NEW
589.0 7.0 26.0 25.56 MB

DeOldify for Stable Diffusion WebUI:This is an extension for StableDiffusion's AUTOMATIC1111 web-ui that allows colorize of old photos and old video. It is based on deoldify.

License: GNU Affero General Public License v3.0

Python 96.81% Smarty 0.19% C++ 0.34% Cuda 1.27% Shell 0.03% Go 1.36%
colorize deoldify sd-webui stable-diffusion stable-diffusion-webui stable-diffusion-webui-plugin webui colorization

sd-webui-deoldify's Introduction

nonebot

DeOldify for Stable Diffusion WebUI

Discord Server QQ Channel

This is an extension for StableDiffusion's AUTOMATIC1111 web-ui that allows colorize of old photos and old video. It is based on deoldify.

example

News

- 2023-08-12:The DeoldifyBot is open source, you can deploy it yourself.

- 2023-08-11:The DeoldifyBot is onlined.You can colorize old photo in Discord.

- 2023-08-07:Support video colorization.

- 2023-08-05:Support install from Extensions list.

- 2023-08-04:sd-webui-deoldify released.

Compatibility

OS

OS Compatibility Remark
Windows 11 Thank for @w-e-w test
Linux

Pytorch

Version Compatibility Remark
<=1.13.1+cu117
2.1.0.dev20230711+rocm5.5 Thanks for @fgtm2023 test
2.0.1+cu118 Thank for @w-e-w test

Other

If you have tested other systems or Pytorch during use, please submit a PR and attach a screenshot of the successful operation. Thank you

Installation

In web-ui, go to the "Extensions" tab and use this URL https://github.com/SpenserCai/sd-webui-deoldify in the "install from URL" tab.

2023-08-05:Support install from Extensions list!!!

If your network is not good, you can download the extension from Hugging Face Model

Usage

  1. In web-ui, go to the "Extra" tab and select "DeOldify" checkbox.

  2. Upload the old photo you want to colorize.

Application Scenario

Combining Upscale, GFPGAN, and Denoldify for old photo restoration effects

Before After
before after

Video Colorization

video_demo


Usage

sudo apt install ffmpeg

In "DeOldify" tab, upload the video you want to colorize,set "Render Factor" and click "Run".

DeOldifyBot

Usage

1.Add Discord Server.

DeoldifyBot

2.Build your own DeOldifyBot

# Instal golang
# https://golang.org/doc/install

# Enter bot directory
cd bot
# Create release directory
mkdir release
# Build
bash build.sh
# create config.json
cp ./config.example ./release/config.json
# Edit config.json
# Set your discord bot token
# Set your sd-webui address

# Run
release/DeOldifyBot

TODO

  • Support video colorization
  • Improve video processing speed
  • Support repair options
  • Support for simultaneous generation of images with different Render Factor values and Artistic on/off like “X/Y/Z Script” #2
  • Support need not to add --disable-safe-unpickle at startup #5

sd-webui-deoldify's People

Contributors

light-and-ray avatar ranareehanaslam avatar spensercai avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

sd-webui-deoldify's Issues

HTTP upload limit for Videos

Hi,

it seems there is a limit of HTTP upload to colorize videos.
I have succesffully uploaded about 293 MB but I think that the limit is set around the 300MB mark.
Is there an option to increase the HTTP upload size?

If not - how can I colorize longer videos?

Running on Mac OS X - Apple Silicon

Error running install.py for extension

Peace, thanks a lot for this great extension, i was waiting to use deoldify with AUTOMATIC111, i got this two error messages when installing the extension, then after the extension installed, i chose deoldify in Extras tab and set image size scale by 1 and clicked generate, i got a new error message.

i am using AMD RX vega 56 GPU in Ubuntu Linux ,  
• AUTOMATIC1111 v1.5.1
• python: 3.10.12
• torch: 2.1.0.dev20230711+rocm5.5  
• gradio: 3.32.0

*** Error running install.py for extension /home/abdo/stable-diffusion-webui/extensions/sd-webui-deoldify.
*** Command: "/usr/local/bin/python" "/home/abdo/stable-diffusion-webui/extensions/sd-webui-deoldify/install.py"
*** Error code: 1
*** stderr:
*** Downloading: 0%| | 0.00/834M [00:00<?, ?B/s]

Traceback (most recent call last):
*** File "/home/abdo/stable-diffusion-webui/extensions/sd-webui-deoldify/install.py", line 43, in
*** download(video_model_url, video_model_path)
*** File "/home/abdo/stable-diffusion-webui/extensions/sd-webui-deoldify/install.py", line 33, in download
*** urllib.request.urlretrieve(url, path, reporthook=lambda count, block_size, total_size: progress.update(block_size))
*** File "/usr/lib/python3.10/urllib/request.py", line 280, in urlretrieve
*** raise ContentTooShortError(
*** urllib.error.ContentTooShortError: <urlopen error retrieval incomplete: got only 873520337 out of 874066230 bytes>

\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

last error message:

Starting job None
Starting job extras
Downloading: "https://download.pytorch.org/models/resnet101-63fe2227.pth" to /home/abdo/.cache/torch/hub/checkpoints/resnet101-63fe2227.pth
98%|█████████████████████████████████████████████████████████████████████████████▌ | 167M/171M [01:26<00:01, 2.03MB/s]
*** Error completing request
*** Arguments: (0, <PIL.Image.Image image mode=RGB size=355x746 at 0x7F18443413C0>, None, '', '', True, 0, 1, 512, 512, True, 'None', 'None', 0, 0, 0, 0, True, 35, False) {}
Traceback (most recent call last):
File "/home/abdo/stable-diffusion-webui/modules/call_queue.py", line 58, in f
res = list(func(*args, **kwargs))
File "/home/abdo/stable-diffusion-webui/modules/call_queue.py", line 37, in f
res = func(*args, **kwargs)
File "/home/abdo/stable-diffusion-webui/modules/postprocessing.py", line 62, in run_postprocessing
scripts.scripts_postproc.run(pp, args)
File "/home/abdo/stable-diffusion-webui/modules/scripts_postprocessing.py", line 130, in run
script.process(pp, **process_args)
File "/home/abdo/stable-diffusion-webui/extensions/sd-webui-deoldify/scripts/postprocessing_deoldify.py", line 54, in process
pp.image = self.process_image(pp.image, render_factor, artistic)
File "/home/abdo/stable-diffusion-webui/extensions/sd-webui-deoldify/scripts/postprocessing_deoldify.py", line 46, in process_image
vis = get_image_colorizer(root_folder=Path("models"),render_factor=render_factor, artistic=artistic)
File "/home/abdo/stable-diffusion-webui/extensions/sd-webui-deoldify/deoldify/visualize.py", line 416, in get_image_colorizer
return get_stable_image_colorizer(root_folder=root_folder, render_factor=render_factor)
File "/home/abdo/stable-diffusion-webui/extensions/sd-webui-deoldify/deoldify/visualize.py", line 425, in get_stable_image_colorizer
learn = gen_inference_wide(root_folder=root_folder, weights_name=weights_name)
File "/home/abdo/stable-diffusion-webui/extensions/sd-webui-deoldify/deoldify/generators.py", line 15, in gen_inference_wide
learn = gen_learner_wide(
File "/home/abdo/stable-diffusion-webui/extensions/sd-webui-deoldify/deoldify/generators.py", line 27, in gen_learner_wide
return unet_learner_wide(
File "/home/abdo/stable-diffusion-webui/extensions/sd-webui-deoldify/deoldify/generators.py", line 58, in unet_learner_wide
body = create_body(arch, pretrained)
File "/home/abdo/stable-diffusion-webui/extensions/sd-webui-deoldify/fastai/vision/learner.py", line 56, in create_body
model = arch(pretrained=pretrained)
File "/home/abdo/.local/lib/python3.10/site-packages/torchvision/models/_utils.py", line 142, in wrapper
return fn(*args, **kwargs)
File "/home/abdo/.local/lib/python3.10/site-packages/torchvision/models/_utils.py", line 228, in inner_wrapper
return builder(*args, **kwargs)
File "/home/abdo/.local/lib/python3.10/site-packages/torchvision/models/resnet.py", line 795, in resnet101
return _resnet(Bottleneck, [3, 4, 23, 3], weights, progress, **kwargs)
File "/home/abdo/.local/lib/python3.10/site-packages/torchvision/models/resnet.py", line 301, in _resnet
model.load_state_dict(weights.get_state_dict(progress=progress, check_hash=True))
File "/home/abdo/.local/lib/python3.10/site-packages/torchvision/models/_api.py", line 90, in get_state_dict
return load_state_dict_from_url(self.url, *args, **kwargs)
File "/home/abdo/.local/lib/python3.10/site-packages/torch/hub.py", line 757, in load_state_dict_from_url
download_url_to_file(url, cached_file, hash_prefix, progress=progress)
File "/home/abdo/.local/lib/python3.10/site-packages/torch/hub.py", line 653, in download_url_to_file
raise RuntimeError('invalid hash value (expected "{}", got "{}")'
RuntimeError: invalid hash value (expected "63fe2227", got "377312f2c100f81e73b6e0a23ee17ef093e4f247490ffa79983bd19b1fafef66")

100% CPU usage, 0% GPU during colorization

As title states, I am using 100% cpu, and none of the GPU when colorizing. I know "device.set(device=DeviceId.GPU0)" makes sure you use GPU0 on the Jupyter Lab version of DeOldify.

Are there some settings anywhere to make sure it uses the GPU?

Dependency on fastai 1.0.60 seems to cause build error on macOS

You might want to loosen this version dependency because AFAIK older fastai versions rely on older pytorch versions that did not support ARM/M1 chips at all, so fastai tries to install with CUDA support enabled which obviously cannot work for ARM machines.

I fixed the issue on my machine by changing for dep in ['wandb','fastai=1.0.60', to for dep in ['wandb','fastai>=1.0.60', in

for dep in ['wandb','fastai==1.0.60', 'tensorboardX', 'ffmpeg', 'ffmpeg-python', 'yt-dlp', 'opencv-python','Pillow']:

While that allows deoldify to install, running it fails since it appears not to be compatible with fastai 2.x+:

***
    Traceback (most recent call last):
      File "/Users/olivierlacan/Development/oss/stable-diffusion-webui/modules/safe.py", line 137, in load_with_extra
        check_pt(filename, extra_handler)
      File "/Users/olivierlacan/Development/oss/stable-diffusion-webui/modules/safe.py", line 95, in check_pt
        unpickler.load()
      File "/Users/olivierlacan/.pyenv/versions/3.10.12/lib/python3.10/pickle.py", line 1213, in load
        dispatch[key[0]](self)
      File "/Users/olivierlacan/.pyenv/versions/3.10.12/lib/python3.10/pickle.py", line 1529, in load_global
        klass = self.find_class(module, name)
      File "/Users/olivierlacan/Development/oss/stable-diffusion-webui/modules/safe.py", line 64, in find_class
        raise Exception(f"global '{module}/{name}' is forbidden")
    Exception: global 'functools/partial' is forbidden

---
*** Error completing request
*** Arguments: (0, <PIL.Image.Image image mode=RGB size=1049x1457 at 0x41BBB4E50>, None, '', '', True, 0, 4, 512, 512, True, 'None', 'None', 0, 0, 0, 0, True, 35, False) {}
    Traceback (most recent call last):
      File "/Users/olivierlacan/Development/oss/stable-diffusion-webui/modules/call_queue.py", line 58, in f
        res = list(func(*args, **kwargs))
      File "/Users/olivierlacan/Development/oss/stable-diffusion-webui/modules/call_queue.py", line 37, in f
        res = func(*args, **kwargs)
      File "/Users/olivierlacan/Development/oss/stable-diffusion-webui/modules/postprocessing.py", line 62, in run_postprocessing
        scripts.scripts_postproc.run(pp, args)
      File "/Users/olivierlacan/Development/oss/stable-diffusion-webui/modules/scripts_postprocessing.py", line 130, in run
        script.process(pp, **process_args)
      File "/Users/olivierlacan/Development/oss/stable-diffusion-webui/extensions/sd-webui-deoldify/scripts/postprocessing_deoldify.py", line 44, in process
        pp.image = self.process_image(pp.image, render_factor, artistic)
      File "/Users/olivierlacan/Development/oss/stable-diffusion-webui/extensions/sd-webui-deoldify/scripts/postprocessing_deoldify.py", line 36, in process_image
        vis = get_image_colorizer(root_folder=Path(paths_internal.models_path),render_factor=render_factor, artistic=artistic)
      File "/Users/olivierlacan/Development/oss/stable-diffusion-webui/extensions/sd-webui-deoldify/deoldify/visualize.py", line 417, in get_image_colorizer
        return get_stable_image_colorizer(root_folder=root_folder, render_factor=render_factor)
      File "/Users/olivierlacan/Development/oss/stable-diffusion-webui/extensions/sd-webui-deoldify/deoldify/visualize.py", line 426, in get_stable_image_colorizer
        learn = gen_inference_wide(root_folder=root_folder, weights_name=weights_name)
      File "/Users/olivierlacan/Development/oss/stable-diffusion-webui/extensions/sd-webui-deoldify/deoldify/generators.py", line 19, in gen_inference_wide
        learn.load(weights_name)
      File "/Users/olivierlacan/Development/oss/stable-diffusion-webui/extensions/sd-webui-deoldify/fastai/basic_train.py", line 267, in load
        if purge: self.purge(clear_opt=ifnone(with_opt, False))
      File "/Users/olivierlacan/Development/oss/stable-diffusion-webui/extensions/sd-webui-deoldify/fastai/basic_train.py", line 325, in purge
        for a in attrs_pkl: setattr(self, a, state[a])
    TypeError: 'NoneType' object is not subscriptable

errors out in webui

i added --disable-safe-unpickle to solve this but its unsafe

Starting job None
Starting job extras
*** Error verifying pickled file from F:\sd\models\deoldify\tmp_j255ppt
*** The file may be malicious, so the program is not going to read it.
*** You can skip this check with --disable-safe-unpickle commandline argument.


Traceback (most recent call last):
  File "F:\sd\modules\safe.py", line 137, in load_with_extra
    check_pt(filename, extra_handler)
  File "F:\sd\modules\safe.py", line 95, in check_pt
    unpickler.load()
  File "C:\Users\BAZO\AppData\Local\Programs\Python\Python310\lib\pickle.py", line 1213, in load
    dispatch[key[0]](self)
  File "C:\Users\BAZO\AppData\Local\Programs\Python\Python310\lib\pickle.py", line 1529, in load_global
    klass = self.find_class(module, name)
  File "F:\sd\modules\safe.py", line 64, in find_class
    raise Exception(f"global '{module}/{name}' is forbidden")
Exception: global 'functools/partial' is forbidden

*** Error completing request
*** Arguments: (0, <PIL.Image.Image image mode=RGB size=512x512 at 0x1E85EC07AC0>, None, '', '', True, 0, 4, 512, 512, True, 'None', 'None', 0, 0, 0, 0, False, False, 4, 'None', False, False, 240, 10, 10, False, False, 8, 'Nearest Neighbor', False, 1, False, 0, True, 35, False) {}
Traceback (most recent call last):
File "F:\sd\modules\call_queue.py", line 58, in f
res = list(func(*args, **kwargs))
File "F:\sd\modules\call_queue.py", line 37, in f
res = func(*args, **kwargs)
File "F:\sd\modules\postprocessing.py", line 62, in run_postprocessing
scripts.scripts_postproc.run(pp, args)
File "F:\sd\modules\scripts_postprocessing.py", line 130, in run
script.process(pp, **process_args)
File "F:\sd\extensions\sd-webui-deoldify\scripts\postprocessing_deoldify.py", line 54, in process
pp.image = self.process_image(pp.image, render_factor, artistic)
File "F:\sd\extensions\sd-webui-deoldify\scripts\postprocessing_deoldify.py", line 46, in process_image
vis = get_image_colorizer(root_folder=Path(paths_internal.models_path),render_factor=render_factor, artistic=artistic)
File "F:\sd\extensions\sd-webui-deoldify\deoldify\visualize.py", line 416, in get_image_colorizer
return get_stable_image_colorizer(root_folder=root_folder, render_factor=render_factor)
File "F:\sd\extensions\sd-webui-deoldify\deoldify\visualize.py", line 425, in get_stable_image_colorizer
learn = gen_inference_wide(root_folder=root_folder, weights_name=weights_name)
File "F:\sd\extensions\sd-webui-deoldify\deoldify\generators.py", line 19, in gen_inference_wide
learn.load(weights_name)
File "F:\sd\extensions\sd-webui-deoldify\fastai\basic_train.py", line 267, in load
if purge: self.purge(clear_opt=ifnone(with_opt, False))
File "F:\sd\extensions\sd-webui-deoldify\fastai\basic_train.py", line 325, in purge
for a in attrs_pkl: setattr(self, a, state[a])
TypeError: 'NoneType' object is not subscriptable

TypeError: 'NoneType' object is not subscriptable

*** Error verifying pickled file from I:\GitHub\stable-diffusion-webui\models\deoldify\tmpftyualnn
*** The file may be malicious, so the program is not going to read it.
*** You can skip this check with --disable-safe-unpickle commandline argument.


Traceback (most recent call last):
  File "I:\GitHub\stable-diffusion-webui\modules\safe.py", line 137, in load_with_extra
    check_pt(filename, extra_handler)
  File "I:\GitHub\stable-diffusion-webui\modules\safe.py", line 95, in check_pt
    unpickler.load()
  File "C:\Users\wyj35\AppData\Local\Programs\Python\Python310\lib\pickle.py", line 1213, in load
    dispatch[key[0]](self)
  File "C:\Users\wyj35\AppData\Local\Programs\Python\Python310\lib\pickle.py", line 1529, in load_global
    klass = self.find_class(module, name)
  File "I:\GitHub\stable-diffusion-webui\modules\safe.py", line 64, in find_class
    raise Exception(f"global '{module}/{name}' is forbidden")
Exception: global 'functools/partial' is forbidden

*** Error completing request
*** Arguments: (0, <PIL.Image.Image image mode=RGB size=800x535 at 0x1A0F98D2DA0>, None, '', '', True, 0, 0, 1, 512, 512, True, 'None', 'None', 0, 0, 0, 0, False, False, 8, False, 1, False, 0, True, 35, True) {}
Traceback (most recent call last):
File "I:\GitHub\stable-diffusion-webui\modules\call_queue.py", line 58, in f
res = list(func(*args, **kwargs))
File "I:\GitHub\stable-diffusion-webui\modules\call_queue.py", line 37, in f
res = func(*args, **kwargs)
File "I:\GitHub\stable-diffusion-webui\modules\postprocessing.py", line 62, in run_postprocessing
scripts.scripts_postproc.run(pp, args)
File "I:\GitHub\stable-diffusion-webui\modules\scripts_postprocessing.py", line 130, in run
script.process(pp, **process_args)
File "I:\GitHub\stable-diffusion-webui\extensions\sd-webui-deoldify\scripts\postprocessing_deoldify.py", line 54, in process
pp.image = self.process_image(pp.image, render_factor, artistic)
File "I:\GitHub\stable-diffusion-webui\extensions\sd-webui-deoldify\scripts\postprocessing_deoldify.py", line 46, in process_image
vis = get_image_colorizer(root_folder=Path(paths_internal.models_path),render_factor=render_factor, artistic=artistic)
File "I:\GitHub\stable-diffusion-webui\extensions\sd-webui-deoldify\deoldify\visualize.py", line 414, in get_image_colorizer
return get_artistic_image_colorizer(root_folder=root_folder, render_factor=render_factor)
File "I:\GitHub\stable-diffusion-webui\extensions\sd-webui-deoldify\deoldify\visualize.py", line 437, in get_artistic_image_colorizer
learn = gen_inference_deep(root_folder=root_folder, weights_name=weights_name)
File "I:\GitHub\stable-diffusion-webui\extensions\sd-webui-deoldify\deoldify\generators.py", line 92, in gen_inference_deep
learn.load(weights_name)
File "I:\GitHub\stable-diffusion-webui\extensions\sd-webui-deoldify\fastai\basic_train.py", line 267, in load
if purge: self.purge(clear_opt=ifnone(with_opt, False))
File "I:\GitHub\stable-diffusion-webui\extensions\sd-webui-deoldify\fastai\basic_train.py", line 325, in purge
for a in attrs_pkl: setattr(self, a, state[a])
TypeError: 'NoneType' object is not subscriptable


TypeError: 'NoneType' object is not subscriptable

*** Arguments: (0, <PIL.Image.Image image mode=RGB size=1219x775 at 0x7F23112F0AD0>, None, '', '', True, 0, 4, 512, 512, True, 'None', 'None', 0, 0, 0, 0, True, 35, False, False) {}
Traceback (most recent call last):
File "/home/user/.local/share/stable-diffusion-webui/modules/call_queue.py", line 57, in f
res = list(func(*args, **kwargs))
^^^^^^^^^^^^^^^^^^^^^
File "/home/user/.local/share/stable-diffusion-webui/modules/call_queue.py", line 36, in f
res = func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/home/user/.local/share/stable-diffusion-webui/modules/postprocessing.py", line 59, in run_postprocessing
scripts.scripts_postproc.run(pp, args)
File "/home/user/.local/share/stable-diffusion-webui/modules/scripts_postprocessing.py", line 130, in run
script.process(pp, **process_args)
File "/home/user/.local/share/stable-diffusion-webui/extensions/sd-webui-deoldify/scripts/postprocessing_deoldify.py", line 49, in process
pp.image = self.process_image(pp.image, render_factor, artistic, pre_decolorization)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/user/.local/share/stable-diffusion-webui/extensions/sd-webui-deoldify/scripts/postprocessing_deoldify.py", line 41, in process_image
vis = get_image_colorizer(root_folder=Path(paths_internal.models_path),render_factor=render_factor, artistic=artistic)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/user/.local/share/stable-diffusion-webui/extensions/sd-webui-deoldify/deoldify/visualize.py", line 426, in get_image_colorizer
return get_stable_image_colorizer(root_folder=root_folder, render_factor=render_factor)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/user/.local/share/stable-diffusion-webui/extensions/sd-webui-deoldify/deoldify/visualize.py", line 435, in get_stable_image_colorizer
learn = gen_inference_wide(root_folder=root_folder, weights_name=weights_name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/user/.local/share/stable-diffusion-webui/extensions/sd-webui-deoldify/deoldify/generators.py", line 19, in gen_inference_wide
learn.load(weights_name)
File "/home/user/.local/share/stable-diffusion-webui/extensions/sd-webui-deoldify/fastai/basic_train.py", line 267, in load
if purge: self.purge(clear_opt=ifnone(with_opt, False))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/user/.local/share/stable-diffusion-webui/extensions/sd-webui-deoldify/fastai/basic_train.py", line 325, in purge
for a in attrs_pkl: setattr(self, a, state[a])

TypeError: 'NoneType' object is not subscriptable

This error is received when attempting to use the DeOldify selection in images.

Unable to run

Unable to run, Already added:
--disable-safe-unpickle

INFO:httpx:HTTP Request: POST http://127.0.0.1:7860/reset "HTTP/1.1 200 OK"
HTTP Request: POST http://127.0.0.1:7860/reset "HTTP/1.1 200 OK"
*** Error verifying pickled file from D:\Stable-Diffusion\SD-WebUI-Aki\models\deoldify\tmp6oy4qnaw
*** The file may be malicious, so the program is not going to read it.
*** You can skip this check with --disable-safe-unpickle commandline argument.


Traceback (most recent call last):
  File "D:\Stable-Diffusion\SD-WebUI-Aki\modules\safe.py", line 137, in load_with_extra
    check_pt(filename, extra_handler)
  File "D:\Stable-Diffusion\SD-WebUI-Aki\modules\safe.py", line 95, in check_pt
    unpickler.load()
  File "D:\Stable-Diffusion\SD-WebUI-Aki\python\lib\pickle.py", line 1213, in load
    dispatch[key[0]](self)
  File "D:\Stable-Diffusion\SD-WebUI-Aki\python\lib\pickle.py", line 1529, in load_global
    klass = self.find_class(module, name)
  File "D:\Stable-Diffusion\SD-WebUI-Aki\modules\safe.py", line 64, in find_class
    raise Exception(f"global '{module}/{name}' is forbidden")
Exception: global 'functools/partial' is forbidden

Traceback (most recent call last):
File "D:\Stable-Diffusion\SD-WebUI-Aki\python\lib\site-packages\gradio\routes.py", line 488, in run_predict
output = await app.get_blocks().process_api(
File "D:\Stable-Diffusion\SD-WebUI-Aki\python\lib\site-packages\gradio\blocks.py", line 1431, in process_api
result = await self.call_function(
File "D:\Stable-Diffusion\SD-WebUI-Aki\python\lib\site-packages\gradio\blocks.py", line 1103, in call_function
prediction = await anyio.to_thread.run_sync(
File "D:\Stable-Diffusion\SD-WebUI-Aki\python\lib\site-packages\anyio\to_thread.py", line 31, in run_sync
return await get_asynclib().run_sync_in_worker_thread(
File "D:\Stable-Diffusion\SD-WebUI-Aki\python\lib\site-packages\anyio_backends_asyncio.py", line 937, in run_sync_in_worker_thread
return await future
File "D:\Stable-Diffusion\SD-WebUI-Aki\python\lib\site-packages\anyio_backends_asyncio.py", line 867, in run
result = context.run(func, *args)
File "D:\Stable-Diffusion\SD-WebUI-Aki\python\lib\site-packages\gradio\utils.py", line 707, in wrapper
response = f(*args, **kwargs)
File "D:\Stable-Diffusion\SD-WebUI-Aki\extensions\sd-webui-deoldify\scripts\ui_deoldify.py", line 20, in process_image
colorizer = get_stable_video_colorizer(root_folder=Path(paths_internal.models_path) ,workfolder=wkfolder)
File "D:\Stable-Diffusion\SD-WebUI-Aki\extensions\sd-webui-deoldify\deoldify\visualize.py", line 414, in get_stable_video_colorizer
learn = gen_inference_wide(root_folder=root_folder, weights_name=weights_name)
File "D:\Stable-Diffusion\SD-WebUI-Aki\extensions\sd-webui-deoldify\deoldify\generators.py", line 19, in gen_inference_wide
learn.load(weights_name)
File "D:\Stable-Diffusion\SD-WebUI-Aki\extensions\sd-webui-deoldify\fastai\basic_train.py", line 267, in load
if purge: self.purge(clear_opt=ifnone(with_opt, False))
File "D:\Stable-Diffusion\SD-WebUI-Aki\extensions\sd-webui-deoldify\fastai\basic_train.py", line 325, in purge
for a in attrs_pkl: setattr(self, a, state[a])
TypeError: 'NoneType' object is not subscriptable

RuntimeError: unexpected EOF

Hi,

I already added --disable-safe-unpickle in webui.bat as below.
%PYTHON% launch.py --disable-safe-unpickle %*

got error as below

RuntimeError: unexpected EOF, expected 103208165 more bytes. The file might be corrupted.
Time taken: 5.04sTorch active/reserved: 3744/3758 MiB, Sys VRAM: 5428/12282 MiB (44.19%)

win10从秋叶sd扩展安装后报错,fastprogress

Tag Autocomplete: Could not locate model-keyword extension, Lora trigger word completion will be limited to those added through the extra networks menu.
2023-10-11 15:14:20,090 - ControlNet - INFO - ControlNet v1.1.410
*** Error loading script: api.py
Traceback (most recent call last):
File "F:\draw\sd-webui-aki\sd-webui-aki-v4.4\modules\scripts.py", line 382, in load_scripts
script_module = script_loading.load_module(scriptfile.path)
File "F:\draw\sd-webui-aki\sd-webui-aki-v4.4\modules\script_loading.py", line 10, in load_module
module_spec.loader.exec_module(module)
File "", line 883, in exec_module
File "", line 241, in call_with_frames_removed
File "F:\draw\sd-webui-aki\sd-webui-aki-v4.4\extensions\sd-webui-deoldify\scripts\api.py", line 15, in
from scripts.deoldify_base import *
File "F:\draw\sd-webui-aki\sd-webui-aki-v4.4\extensions\sd-webui-deoldify\scripts\deoldify_base.py", line 23, in
from deoldify.visualize import *
File "F:\draw\sd-webui-aki\sd-webui-aki-v4.4\extensions\sd-webui-deoldify\deoldify\visualize.py", line 1, in
from fastai.core import *
File "F:\draw\sd-webui-aki\sd-webui-aki-v4.4\extensions\sd-webui-deoldify\fastai\core.py", line 2, in
from .imports.core import *
File "F:\draw\sd-webui-aki\sd-webui-aki-v4.4\extensions\sd-webui-deoldify\fastai\imports_init
.py", line 1, in
from .core import *
File "F:\draw\sd-webui-aki\sd-webui-aki-v4.4\extensions\sd-webui-deoldify\fastai\imports\core.py", line 24, in
from fastprogress.fastprogress import MasterBar, ProgressBar
ModuleNotFoundError: No module named 'fastprogress'


*** Error loading script: deoldify_base.py
Traceback (most recent call last):
File "F:\draw\sd-webui-aki\sd-webui-aki-v4.4\modules\scripts.py", line 382, in load_scripts
script_module = script_loading.load_module(scriptfile.path)
File "F:\draw\sd-webui-aki\sd-webui-aki-v4.4\modules\script_loading.py", line 10, in load_module
module_spec.loader.exec_module(module)
File "", line 883, in exec_module
File "", line 241, in call_with_frames_removed
File "F:\draw\sd-webui-aki\sd-webui-aki-v4.4\extensions\sd-webui-deoldify\scripts\deoldify_base.py", line 23, in
from deoldify.visualize import *
File "F:\draw\sd-webui-aki\sd-webui-aki-v4.4\extensions\sd-webui-deoldify\deoldify\visualize.py", line 1, in
from fastai.core import *
File "F:\draw\sd-webui-aki\sd-webui-aki-v4.4\extensions\sd-webui-deoldify\fastai\core.py", line 2, in
from .imports.core import *
File "F:\draw\sd-webui-aki\sd-webui-aki-v4.4\extensions\sd-webui-deoldify\fastai\imports_init
.py", line 1, in
from .core import *
File "F:\draw\sd-webui-aki\sd-webui-aki-v4.4\extensions\sd-webui-deoldify\fastai\imports\core.py", line 24, in
from fastprogress.fastprogress import MasterBar, ProgressBar
ModuleNotFoundError: No module named 'fastprogress'


*** Error loading script: postprocessing_deoldify.py
Traceback (most recent call last):
File "F:\draw\sd-webui-aki\sd-webui-aki-v4.4\modules\scripts.py", line 382, in load_scripts
script_module = script_loading.load_module(scriptfile.path)
File "F:\draw\sd-webui-aki\sd-webui-aki-v4.4\modules\script_loading.py", line 10, in load_module
module_spec.loader.exec_module(module)
File "", line 883, in exec_module
File "", line 241, in call_with_frames_removed
File "F:\draw\sd-webui-aki\sd-webui-aki-v4.4\extensions\sd-webui-deoldify\scripts\postprocessing_deoldify.py", line 12, in
from scripts.deoldify_base import *
File "F:\draw\sd-webui-aki\sd-webui-aki-v4.4\extensions\sd-webui-deoldify\scripts\deoldify_base.py", line 23, in
from deoldify.visualize import *
File "F:\draw\sd-webui-aki\sd-webui-aki-v4.4\extensions\sd-webui-deoldify\deoldify\visualize.py", line 1, in
from fastai.core import *
File "F:\draw\sd-webui-aki\sd-webui-aki-v4.4\extensions\sd-webui-deoldify\fastai\core.py", line 2, in
from .imports.core import *
File "F:\draw\sd-webui-aki\sd-webui-aki-v4.4\extensions\sd-webui-deoldify\fastai\imports_init
.py", line 1, in
from .core import *
File "F:\draw\sd-webui-aki\sd-webui-aki-v4.4\extensions\sd-webui-deoldify\fastai\imports\core.py", line 24, in
from fastprogress.fastprogress import MasterBar, ProgressBar
ModuleNotFoundError: No module named 'fastprogress'


*** Error loading script: ui_deoldify.py
Traceback (most recent call last):
File "F:\draw\sd-webui-aki\sd-webui-aki-v4.4\modules\scripts.py", line 382, in load_scripts
script_module = script_loading.load_module(scriptfile.path)
File "F:\draw\sd-webui-aki\sd-webui-aki-v4.4\modules\script_loading.py", line 10, in load_module
module_spec.loader.exec_module(module)
File "", line 883, in exec_module
File "", line 241, in call_with_frames_removed
File "F:\draw\sd-webui-aki\sd-webui-aki-v4.4\extensions\sd-webui-deoldify\scripts\ui_deoldify.py", line 10, in
from scripts.deoldify_base import *
File "F:\draw\sd-webui-aki\sd-webui-aki-v4.4\extensions\sd-webui-deoldify\scripts\deoldify_base.py", line 23, in
from deoldify.visualize import *
File "F:\draw\sd-webui-aki\sd-webui-aki-v4.4\extensions\sd-webui-deoldify\deoldify\visualize.py", line 1, in
from fastai.core import *
File "F:\draw\sd-webui-aki\sd-webui-aki-v4.4\extensions\sd-webui-deoldify\fastai\core.py", line 2, in
from .imports.core import *
File "F:\draw\sd-webui-aki\sd-webui-aki-v4.4\extensions\sd-webui-deoldify\fastai\imports_init
.py", line 1, in
from .core import *
File "F:\draw\sd-webui-aki\sd-webui-aki-v4.4\extensions\sd-webui-deoldify\fastai\imports\core.py", line 24, in
from fastprogress.fastprogress import MasterBar, ProgressBar
ModuleNotFoundError: No module named 'fastprogress'

FileNotFoundError: [WinError 2] The system cannot find the file specified

Got this error line on video deoldifying

HTTP Request: POST http://127.0.0.1:7860/api/predict "HTTP/1.1 500 Internal Server Error"
HTTP Request: POST http://127.0.0.1:7860/reset "HTTP/1.1 200 OK"
Errror while extracting raw frames from source video. Details: [WinError 2] The system cannot find the file specified
Traceback (most recent call last):
File "D:\Machine Learning\sd.webui\webui\extensions\sd-webui-deoldify\deoldify\visualize.py", line 251, in _extract_raw_frames
process.run()
File "D:\Machine Learning\sd.webui\system\python\lib\site-packages\ffmpeg_run.py", line 313, in run
process = run_async(
File "D:\Machine Learning\sd.webui\system\python\lib\site-packages\ffmpeg_run.py", line 284, in run_async
return subprocess.Popen(
File "subprocess.py", line 969, in init
File "subprocess.py", line 1438, in _execute_child
FileNotFoundError: [WinError 2] The system cannot find the file specified
image
image

Error when trying to generate

Installed in Automatic1111 version: v1.5.1  •  python: 3.10.6  •  torch: 2.0.1+cu118  •  xformers: 0.0.20  •  gradio: 3.32.0  •  checkpoint: ec41bd2a82
and get the error below after clicking generate.

TypeError: 'NoneType' object is not subscriptable

Then this in console

`*** Error verifying pickled file from C:\Users\user\stable-diffusion-webui\models\deoldify\tmpmv1m3lcr
*** The file may be malicious, so the program is not going to read it.
*** You can skip this check with --disable-safe-unpickle commandline argument.


Traceback (most recent call last):
  File "C:\Users\user\stable-diffusion-webui\modules\safe.py", line 137, in load_with_extra
    check_pt(filename, extra_handler)
  File "C:\Users\user\stable-diffusion-webui\modules\safe.py", line 95, in check_pt
    unpickler.load()
  File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\pickle.py", line 1213, in load
    dispatch[key[0]](self)
  File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\pickle.py", line 1529, in load_global
    klass = self.find_class(module, name)
  File "C:\Users\user\stable-diffusion-webui\modules\safe.py", line 64, in find_class
    raise Exception(f"global '{module}/{name}' is forbidden")
Exception: global 'functools/partial' is forbidden

*** Error completing request
*** Arguments: (0, <PIL.Image.Image image mode=RGB size=1502x1502 at 0x2DA2E5F43A0>, None, '', '', True, 0, 1, 512, 512, True, 'None', 'None', 0, 0, 0, 0, True, 35, False) {}
Traceback (most recent call last):
File "C:\Users\user\stable-diffusion-webui\modules\call_queue.py", line 58, in f
res = list(func(*args, **kwargs))
File "C:\Users\user\stable-diffusion-webui\modules\call_queue.py", line 37, in f
res = func(*args, **kwargs)
File "C:\Users\user\stable-diffusion-webui\modules\postprocessing.py", line 62, in run_postprocessing
scripts.scripts_postproc.run(pp, args)
File "C:\Users\user\stable-diffusion-webui\modules\scripts_postprocessing.py", line 130, in run
script.process(pp, **process_args)
File "C:\Users\user\stable-diffusion-webui\extensions\sd-webui-deoldify\scripts\postprocessing_deoldify.py", line 54, in process
pp.image = self.process_image(pp.image, render_factor, artistic)
File "C:\Users\user\stable-diffusion-webui\extensions\sd-webui-deoldify\scripts\postprocessing_deoldify.py", line 46, in process_image
vis = get_image_colorizer(root_folder=Path(paths_internal.models_path),render_factor=render_factor, artistic=artistic)
File "C:\Users\user\stable-diffusion-webui\extensions\sd-webui-deoldify\deoldify\visualize.py", line 416, in get_image_colorizer
return get_stable_image_colorizer(root_folder=root_folder, render_factor=render_factor)
File "C:\Users\user\stable-diffusion-webui\extensions\sd-webui-deoldify\deoldify\visualize.py", line 425, in get_stable_image_colorizer
learn = gen_inference_wide(root_folder=root_folder, weights_name=weights_name)
File "C:\Users\user\stable-diffusion-webui\extensions\sd-webui-deoldify\deoldify\generators.py", line 19, in gen_inference_wide
learn.load(weights_name)
File "C:\Users\user\stable-diffusion-webui\extensions\sd-webui-deoldify\fastai\basic_train.py", line 267, in load
if purge: self.purge(clear_opt=ifnone(with_opt, False))
File "C:\Users\user\stable-diffusion-webui\extensions\sd-webui-deoldify\fastai\basic_train.py", line 325, in purge
for a in attrs_pkl: setattr(self, a, state[a])
TypeError: 'NoneType' object is not subscriptable


HTTP Request: POST http://127.0.0.1:7860/api/predict "HTTP/1.1 200 OK"
HTTP Request: POST http://127.0.0.1:7860/reset "HTTP/1.1 200 OK"
`

image deoldify throws error: "RuntimeError: unexpected EOF, expected 21676130 more bytes. The file might be corrupted."

Hi, I get the error "RuntimeError: unexpected EOF, expected 21676130 more bytes. The file might be corrupted." when i attempt to deoldify an image.

steps to reproduce:

  1. remove the controlnet extension (after much troubleshooting one by one, I notice that deoldify will only respond when this essential extension is removed)
  2. in a1111, navigate to extras > deoldify, add an image to deoldify, leave settings as is.
  3. the following errors result:
    `INFO:modules.shared_state:Starting job task(b2nnnl3g583i69z)
    Starting job task(b2nnnl3g583i69z)
    INFO:modules.shared_state:Starting job extras
    Starting job extras
    *** Error completing request
    *** Arguments: ('task(b2nnnl3g583i69z)', 0, <PIL.Image.Image image mode=RGB size=1280x1808 at 0x22985206860>, None, '', '', True, 0, 4, 512, 512, True, '4x_NMKD-SuperscaleV2_46k', 'None', 0, False, 1, False, 1, 0, False, 0.9, 0.15, 0.5, False, False, 384, 768, 4096, 409600, 'Maximize area', 0.1, False, ['Deepbooru'], False, ['Horizontal'], False, 0.5, 0.2, True, 35, False, False) {}
    Traceback (most recent call last):
    File "C:\Projects\ai\automatic1111\modules\call_queue.py", line 57, in f
    res = list(func(*args, **kwargs))
    File "C:\Projects\ai\automatic1111\modules\call_queue.py", line 36, in f
    res = func(*args, **kwargs)
    File "C:\Projects\ai\automatic1111\modules\postprocessing.py", line 132, in run_postprocessing_webui
    return run_postprocessing(*args, **kwargs)
    File "C:\Projects\ai\automatic1111\modules\postprocessing.py", line 73, in run_postprocessing
    scripts.scripts_postproc.run(initial_pp, args)
    File "C:\Projects\ai\automatic1111\modules\scripts_postprocessing.py", line 196, in run
    script.process(single_image, **process_args)
    File "C:\Projects\ai\automatic1111\extensions\sd-webui-deoldify\scripts\postprocessing_deoldify.py", line 49, in process
    pp.image = self.process_image(pp.image, render_factor, artistic, pre_decolorization)
    File "C:\Projects\ai\automatic1111\extensions\sd-webui-deoldify\scripts\postprocessing_deoldify.py", line 41, in process_image
    vis = get_image_colorizer(root_folder=Path(paths_internal.models_path),render_factor=render_factor, artistic=artistic)
    File "C:\Projects\ai\automatic1111\extensions\sd-webui-deoldify\deoldify\visualize.py", line 426, in get_image_colorizer
    return get_stable_image_colorizer(root_folder=root_folder, render_factor=render_factor)
    File "C:\Projects\ai\automatic1111\extensions\sd-webui-deoldify\deoldify\visualize.py", line 435, in get_stable_image_colorizer
    learn = gen_inference_wide(root_folder=root_folder, weights_name=weights_name)
    File "C:\Projects\ai\automatic1111\extensions\sd-webui-deoldify\deoldify\generators.py", line 19, in gen_inference_wide
    learn.load(weights_name)
    File "C:\Projects\ai\automatic1111\extensions\sd-webui-deoldify\fastai\basic_train.py", line 271, in load
    state = torch.load(source, map_location=device)
    File "C:\Projects\ai\automatic1111\modules\safe.py", line 108, in load
    return load_with_extra(filename, *args, extra_handler=global_extra_handler, **kwargs)
    File "C:\Projects\ai\automatic1111\modules\safe.py", line 156, in load_with_extra
    return unsafe_torch_load(filename, *args, **kwargs)
    File "C:\Projects\ai\automatic1111\venv\lib\site-packages\torch\serialization.py", line 815, in load
    return _legacy_load(opened_file, map_location, pickle_module, **pickle_load_args)
    File "C:\Projects\ai\automatic1111\venv\lib\site-packages\torch\serialization.py", line 1051, in _legacy_load
    typed_storage._untyped_storage._set_from_file(
    RuntimeError: unexpected EOF, expected 21676130 more bytes. The file might be corrupted.

INFO:httpx:HTTP Request: POST http://127.0.0.1:7860/api/predict "HTTP/1.1 200 OK"
HTTP Request: POST http://127.0.0.1:7860/api/predict "HTTP/1.1 200 OK"
INFO:httpx:HTTP Request: POST http://127.0.0.1:7860/reset "HTTP/1.1 200 OK"
HTTP Request: POST http://127.0.0.1:7860/reset "HTTP/1.1 200 OK"`

Note, if i tick 'artistic', then deoldify will work. what does that do and why will it only work with that setting? Why won't it work with controlnet installed?

safe uninstall

how can I safely unistall the extension whithout using the Automatic1111 UI?
After the installation the UI does not work any more and Stable Diffusion crashes on startup so I need to remove the whole Deoldify to try to recover my functioning installation of SD.
I've noticed that the "delete the extension folder" method does not work here, so there has to be some more thing to be kept in mind when trying to remove.

TypeError: 'NoneType' object is not subscriptable

sdxl automatic1111 on windows 11
install deoldify from extentions
go to extras and check deoldfy box
import jpeg image
click generate
result is : TypeError: 'NoneType' object is not subscriptable

(no error if i uncheck deoldify)

CMD spamming HTTP Request

Hi, I've finally found this extension provokes a "spamming" in my cmd interface (and doesn't work), I have no idea why, and don't know enough to know where to look as for why.
Main issue with this extension activated is this spam :

HTTP Request: POST http://127.0.0.1:7860/reset "HTTP/1.1 200 OK"
INFO:httpx:HTTP Request: POST http://127.0.0.1:7860/reset "HTTP/1.1 200 OK"
HTTP Request: POST http://127.0.0.1:7860/reset "HTTP/1.1 200 OK"
INFO:httpx:HTTP Request: POST http://127.0.0.1:7860/reset "HTTP/1.1 200 OK"
HTTP Request: POST http://127.0.0.1:7860/reset "HTTP/1.1 200 OK"
INFO:httpx:HTTP Request: POST http://127.0.0.1:7860/reset "HTTP/1.1 200 OK"
HTTP Request: POST http://127.0.0.1:7860/reset "HTTP/1.1 200 OK"
INFO:httpx:HTTP Request: POST http://127.0.0.1:7860/reset "HTTP/1.1 200 OK"
HTTP Request: POST http://127.0.0.1:7860/reset "HTTP/1.1 200 OK"
INFO:httpx:HTTP Request: POST http://127.0.0.1:7860/api/predict "HTTP/1.1 200 OK"
HTTP Request: POST http://127.0.0.1:7860/api/predict "HTTP/1.1 200 OK"
INFO:httpx:HTTP Request: POST http://127.0.0.1:7860/api/predict "HTTP/1.1 200 OK"
HTTP Request: POST http://127.0.0.1:7860/api/predict "HTTP/1.1 200 OK"
INFO:httpx:HTTP Request: POST http://127.0.0.1:7860/api/predict "HTTP/1.1 200 OK"
HTTP Request: POST http://127.0.0.1:7860/api/predict "HTTP/1.1 200 OK"
INFO:httpx:HTTP Request: POST http://127.0.0.1:7860/api/predict "HTTP/1.1 200 OK"
HTTP Request: POST http://127.0.0.1:7860/api/predict "HTTP/1.1 200 OK"
INFO:httpx:HTTP Request: POST http://127.0.0.1:7860/api/predict "HTTP/1.1 200 OK"
HTTP Request: POST http://127.0.0.1:7860/api/predict "HTTP/1.1 200 OK"

Also this :

INFO:modules.shared_state:Ending job Deoldify (1.16 seconds)
Ending job Deoldify (1.16 seconds)

Some errors I've found in the cmd that feels like they are relevant :

*** Error verifying pickled file from S:\AI\StableDiffusion-Git\models\deoldify\tmplga18j59
*** The file may be malicious, so the program is not going to read it.
*** You can skip this check with --disable-safe-unpickle commandline argument.


Traceback (most recent call last):
  File "S:\AI\StableDiffusion-Git\modules\safe.py", line 137, in load_with_extra
    check_pt(filename, extra_handler)
  File "S:\AI\StableDiffusion-Git\modules\safe.py", line 95, in check_pt
    unpickler.load()
  File "S:\AI\StableDiffusion-Git\modules\safe.py", line 64, in find_class
    raise Exception(f"global '{module}/{name}' is forbidden")
Exception: global 'functools/partial' is forbidden

*** Error completing request
*** Arguments: (0, <PIL.Image.Image image mode=RGB size=1488x1984 at 0x24C97C0A8F0>, None, '', '', True, 0, 1, 512, 512, True, 'None', 'None', 0, 0, 0, 0, 'isnet-general-use', False, False, 240, 10, 10, True, 35, False) {}
Traceback (most recent call last):
File "S:\AI\StableDiffusion-Git\modules\call_queue.py", line 57, in f
res = list(func(*args, **kwargs))
File "S:\AI\StableDiffusion-Git\modules\call_queue.py", line 36, in f
res = func(*args, **kwargs)
File "S:\AI\StableDiffusion-Git\modules\postprocessing.py", line 59, in run_postprocessing
scripts.scripts_postproc.run(pp, args)
File "S:\AI\StableDiffusion-Git\modules\scripts_postprocessing.py", line 130, in run
script.process(pp, **process_args)
File "S:\AI\StableDiffusion-Git\extensions\sd-webui-deoldify\scripts\postprocessing_deoldify.py", line 44, in process
pp.image = self.process_image(pp.image, render_factor, artistic)
File "S:\AI\StableDiffusion-Git\extensions\sd-webui-deoldify\scripts\postprocessing_deoldify.py", line 36, in process_image
vis = get_image_colorizer(root_folder=Path(paths_internal.models_path),render_factor=render_factor, artistic=artistic)
File "S:\AI\StableDiffusion-Git\extensions\sd-webui-deoldify\deoldify\visualize.py", line 426, in get_image_colorizer
return get_stable_image_colorizer(root_folder=root_folder, render_factor=render_factor)
File "S:\AI\StableDiffusion-Git\extensions\sd-webui-deoldify\deoldify\visualize.py", line 435, in get_stable_image_colorizer
learn = gen_inference_wide(root_folder=root_folder, weights_name=weights_name)
File "S:\AI\StableDiffusion-Git\extensions\sd-webui-deoldify\deoldify\generators.py", line 19, in gen_inference_wide
learn.load(weights_name)
File "S:\AI\StableDiffusion-Git\extensions\sd-webui-deoldify\fastai\basic_train.py", line 267, in load
if purge: self.purge(clear_opt=ifnone(with_opt, False))
File "S:\AI\StableDiffusion-Git\extensions\sd-webui-deoldify\fastai\basic_train.py", line 325, in purge
for a in attrs_pkl: setattr(self, a, state[a])
TypeError: 'NoneType' object is not subscriptable


OS : W10 x64
64GB Ram
GTX 1080

If you need anything else, please do ask
And if anyone could help me fix this error, that'd be awesome !
Thanks :)

Experimenting with included demo.jpeg

Experimenting with included demo.jpeg

Starting job extras
*** Error completing request
*** Arguments: (0, <PIL.Image.Image image mode=RGB size=793x468 at 0x190C2038730>, None, '', '', True, 0, 1, 512, 512, True, 'None', 'None', 0, 0, 0, 0, True, 35, False) {}
Traceback (most recent call last):
File "D:\stable-diffusion-webui\modules\call_queue.py", line 58, in f
res = list(func(*args, **kwargs))
File "D:\stable-diffusion-webui\modules\call_queue.py", line 37, in f
res = func(*args, **kwargs)
File "D:\stable-diffusion-webui\modules\postprocessing.py", line 62, in run_postprocessing
scripts.scripts_postproc.run(pp, args)
File "D:\stable-diffusion-webui\modules\scripts_postprocessing.py", line 130, in run
script.process(pp, **process_args)
File "D:\stable-diffusion-webui\extensions\sd-webui-deoldify\scripts\postprocessing_deoldify.py", line 63, in process
pp.image = self.process_image(pp.image, render_factor, artistic)
File "D:\stable-diffusion-webui\extensions\sd-webui-deoldify\scripts\postprocessing_deoldify.py", line 55, in process_image
vis = get_image_colorizer(root_folder=Path(paths_internal.models_path),render_factor=render_factor, artistic=artistic)
File "D:\stable-diffusion-webui\extensions\sd-webui-deoldify\deoldify\visualize.py", line 417, in get_image_colorizer
return get_stable_image_colorizer(root_folder=root_folder, render_factor=render_factor)
File "D:\stable-diffusion-webui\extensions\sd-webui-deoldify\deoldify\visualize.py", line 426, in get_stable_image_colorizer
learn = gen_inference_wide(root_folder=root_folder, weights_name=weights_name)
File "D:\stable-diffusion-webui\extensions\sd-webui-deoldify\deoldify\generators.py", line 19, in gen_inference_wide
learn.load(weights_name)
File "D:\stable-diffusion-webui\extensions\sd-webui-deoldify\fastai\basic_train.py", line 271, in load
state = torch.load(source, map_location=device)
File "D:\stable-diffusion-webui\modules\safe.py", line 108, in load
return load_with_extra(filename, *args, extra_handler=global_extra_handler, **kwargs)
File "D:\stable-diffusion-webui\modules\safe.py", line 156, in load_with_extra
return unsafe_torch_load(filename, *args, **kwargs)
File "D:\stable-diffusion-webui\venv\lib\site-packages\torch\serialization.py", line 815, in load
return _legacy_load(opened_file, map_location, pickle_module, **pickle_load_args)
File "D:\stable-diffusion-webui\venv\lib\site-packages\torch\serialization.py", line 1051, in _legacy_load
typed_storage._untyped_storage._set_from_file(
RuntimeError: unexpected EOF, expected 7913014 more bytes. The file might be corrupted.


2023-08-07 18:32:29 INFO [httpx] HTTP Request: POST http://127.0.0.1:7860/api/predict "HTTP/1.1 200 OK"
HTTP Request: POST http://127.0.0.1:7860/api/predict "HTTP/1.1 200 OK"
2023-08-07 18:32:29 INFO [httpx] HTTP Request: POST http://127.0.0.1:7860/reset "HTTP/1.1 200 OK"
HTTP Request: POST http://127.0.0.1:7860/reset "HTTP/1.1 200 OK"

no output image

TypeError: 'NoneType' object is not subscriptable

Time taken: 1 min. 5.7 sec.

A: 3.27 GB, R: 4.06 GB, Sys: 4.0/4 GB (100.0%)

Can not run launch.py

In linux,

python launch.py
Traceback (most recent call last):
File "/home/quant/myapps/oldphotos/stable-diffusion-webui/launch.py", line 1, in
from modules import launch_utils
ImportError: cannot import name 'launch_utils' from 'modules' (/home/abc/.virtualenvs/oldphotos/lib/python3.11/site-packages/modules.py)

Thanks.

Traceback error

When I was testing it on an BW image I got errors as follow:

In the ui the error:

TypeError: 'NoneType' object is not subscriptable
Time taken: 6.2 sec.

A: 3.56 GB, R: 3.56 GB, Sys: 6.2/23.9883 GB (25.9%)

and from the log error:

*** Error completing request
*** Arguments: (0, <PIL.Image.Image image mode=RGB size=976x549 at 0x200521FEA10>, None, '', '', True, 0, 1, 512, 512, True, 'None', 'None', 0, 0, 0, 0, True, 35, False) {}
    Traceback (most recent call last):
      File "E:\stable-diffusion-webui\modules\call_queue.py", line 58, in f
        res = list(func(*args, **kwargs))
      File "E:\stable-diffusion-webui\modules\call_queue.py", line 37, in f
        res = func(*args, **kwargs)
      File "E:\stable-diffusion-webui\modules\postprocessing.py", line 62, in run_postprocessing
        scripts.scripts_postproc.run(pp, args)
      File "E:\stable-diffusion-webui\modules\scripts_postprocessing.py", line 130, in run
        script.process(pp, **process_args)
      File "E:\stable-diffusion-webui\extensions\sd-webui-deoldify\scripts\postprocessing_deoldify.py", line 54, in process
        pp.image = self.process_image(pp.image, render_factor, artistic)
      File "E:\stable-diffusion-webui\extensions\sd-webui-deoldify\scripts\postprocessing_deoldify.py", line 46, in process_image
        vis = get_image_colorizer(root_folder=Path(paths_internal.models_path),render_factor=render_factor, artistic=artistic)
      File "E:\stable-diffusion-webui\extensions\sd-webui-deoldify\deoldify\visualize.py", line 416, in get_image_colorizer
        return get_stable_image_colorizer(root_folder=root_folder, render_factor=render_factor)
      File "E:\stable-diffusion-webui\extensions\sd-webui-deoldify\deoldify\visualize.py", line 425, in get_stable_image_colorizer
        learn = gen_inference_wide(root_folder=root_folder, weights_name=weights_name)
      File "E:\stable-diffusion-webui\extensions\sd-webui-deoldify\deoldify\generators.py", line 19, in gen_inference_wide
        learn.load(weights_name)
      File "E:\stable-diffusion-webui\extensions\sd-webui-deoldify\fastai\basic_train.py", line 267, in load
        if purge: self.purge(clear_opt=ifnone(with_opt, False))
      File "E:\stable-diffusion-webui\extensions\sd-webui-deoldify\fastai\basic_train.py", line 325, in purge
        for a in attrs_pkl: setattr(self, a, state[a])
    TypeError: 'NoneType' object is not subscriptable

---
INFO:httpx:HTTP Request: POST http://127.0.0.1:7860/api/predict "HTTP/1.1 200 OK"
HTTP Request: POST http://127.0.0.1:7860/api/predict "HTTP/1.1 200 OK"
INFO:httpx:HTTP Request: POST http://127.0.0.1:7860/reset "HTTP/1.1 200 OK"
HTTP Request: POST http://127.0.0.1:7860/reset "HTTP/1.1 200 OK"

Windows 10 Confirmation

Thank you for this, BTW.

Just wanted to let you know that it's also working on Windows 10 (22H2) w/ Python 3.10.6 & Torch 2.0.1+cu118, Torchvision 0.15.2, Pillow 9.5.0, & opencv-python 4.8.0.76

Artistic and Pre-decolor enabled
2023-09-27_135940

Stable model, no pre-decolor
2023-09-27_141219
(Sorry, no fork, so I can't PR as requested)

UserWarning: Your training set is empty and FileNotFoundError: [WinError 2] for video

Hi, I am trying to run DeOldlify for video without success. DeOldify works for single image without any issues. I have ffmpeg and I updated PATH.

g:\Ai\Soft\sd.webui\webui\extensions\sd-webui-deoldify\fastai\data_block.py:451: UserWarning: Your training set is empty. If this is by design, pass `ignore_empty=True` to remove this warning.
  warn("Your training set is empty. If this is by design, pass `ignore_empty=True` to remove this warning.")
g:\Ai\Soft\sd.webui\webui\extensions\sd-webui-deoldify\fastai\data_block.py:453: UserWarning: Your validation set is empty. If this is by design, use `split_none()`
                 or pass `ignore_empty=True` when labelling to remove this warning.
  warn("""Your validation set is empty. If this is by design, use `split_none()`
g:\Ai\Soft\sd.webui\system\python\lib\site-packages\torchvision\models\_utils.py:208: UserWarning: The parameter 'pretrained' is deprecated since 0.13 and may be removed in the future, please use 'weights' instead.
  warnings.warn(
g:\Ai\Soft\sd.webui\system\python\lib\site-packages\torchvision\models\_utils.py:223: UserWarning: Arguments other than a weight enum or `None` for 'weights' are deprecated since 0.13 and may be removed in the future. The current behavior is equivalent to passing `weights=ResNet101_Weights.IMAGENET1K_V1`. You can also use `weights=ResNet101_Weights.DEFAULT` to get the most up-to-date weights.
  warnings.warn(msg)
Errror while extracting raw frames from source video.  Details: [WinError 2] system cannot find the specified file
Traceback (most recent call last):
  File "g:\Ai\Soft\sd.webui\webui\extensions\sd-webui-deoldify\deoldify\visualize.py", line 251, in _extract_raw_frames
    process.run()
  File "g:\Ai\Soft\sd.webui\system\python\lib\site-packages\ffmpeg\_run.py", line 313, in run
    process = run_async(
  File "g:\Ai\Soft\sd.webui\system\python\lib\site-packages\ffmpeg\_run.py", line 284, in run_async
    return subprocess.Popen(
  File "subprocess.py", line 969, in __init__
  File "subprocess.py", line 1438, in _execute_child
FileNotFoundError: [WinError 2] system cannot find the specified file
Traceback (most recent call last):
  File "g:\Ai\Soft\sd.webui\system\python\lib\site-packages\gradio\routes.py", line 422, in run_predict
    output = await app.get_blocks().process_api(
  File "g:\Ai\Soft\sd.webui\system\python\lib\site-packages\gradio\blocks.py", line 1323, in process_api
    result = await self.call_function(
  File "g:\Ai\Soft\sd.webui\system\python\lib\site-packages\gradio\blocks.py", line 1051, in call_function
    prediction = await anyio.to_thread.run_sync(
  File "g:\Ai\Soft\sd.webui\system\python\lib\site-packages\anyio\to_thread.py", line 33, in run_sync
    return await get_asynclib().run_sync_in_worker_thread(
  File "g:\Ai\Soft\sd.webui\system\python\lib\site-packages\anyio\_backends\_asyncio.py", line 877, in run_sync_in_worker_thread
    return await future
  File "g:\Ai\Soft\sd.webui\system\python\lib\site-packages\anyio\_backends\_asyncio.py", line 807, in run
    result = context.run(func, *args)
  File "g:\Ai\Soft\sd.webui\webui\extensions\sd-webui-deoldify\scripts\ui_deoldify.py", line 28, in process_image
    out_video = colorizer.colorize_from_file_name(video_name, render_factor=render_factor,g_process_bar=process)
  File "g:\Ai\Soft\sd.webui\webui\extensions\sd-webui-deoldify\deoldify\visualize.py", line 372, in colorize_from_file_name
    return self._colorize_from_path(
  File "g:\Ai\Soft\sd.webui\webui\extensions\sd-webui-deoldify\deoldify\visualize.py", line 384, in _colorize_from_path
    self._extract_raw_frames(source_path)
  File "g:\Ai\Soft\sd.webui\webui\extensions\sd-webui-deoldify\deoldify\visualize.py", line 259, in _extract_raw_frames
    raise e
  File "g:\Ai\Soft\sd.webui\webui\extensions\sd-webui-deoldify\deoldify\visualize.py", line 251, in _extract_raw_frames
    process.run()
  File "g:\Ai\Soft\sd.webui\system\python\lib\site-packages\ffmpeg\_run.py", line 313, in run
    process = run_async(
  File "g:\Ai\Soft\sd.webui\system\python\lib\site-packages\ffmpeg\_run.py", line 284, in run_async
    return subprocess.Popen(
  File "subprocess.py", line 969, in __init__
  File "subprocess.py", line 1438, in _execute_child
FileNotFoundError: [WinError 2] system cannot find the specified file

video colorization not working

File "C:\PORTABLE\sd.webui\system\python\lib\site-packages\ffmpeg_run.py", line 313, in run
process = run_async(
File "C:\PORTABLE\sd.webui\system\python\lib\site-packages\ffmpeg_run.py", line 284, in run_async
return subprocess.Popen(
File "subprocess.py", line 969, in init
File "subprocess.py", line 1438, in _execute_child
FileNotFoundError: [WinError 2] The system cannot find the file specified
INFO:httpx:HTTP Request: POST http://127.0.0.1:7860/api/predict "HTTP/1.1 500 Internal Server Error"
HTTP Request: POST http://127.0.0.1:7860/api/predict "HTTP/1.1 500 Internal Server Error"
INFO:httpx:HTTP Request: POST http://127.0.0.1:7860/reset "HTTP/1.1 200 OK"
HTTP Request: POST http://127.0.0.1:7860/reset "HTTP/1.1 200 OK"

cant run it, gives this error

ERROR:root:Errror while extracting raw frames from source video. Details: [WinError 2] The system cannot find the file specified
Traceback (most recent call last):
File "D:\New folder\sd\stable-diffusion-webui\extensions\sd-webui-deoldify\deoldify\visualize.py", line 251, in _extract_raw_frames
process.run()
File "D:\New folder\sd\stable-diffusion-webui\venv\lib\site-packages\ffmpeg_run.py", line 313, in run
process = run_async(
File "D:\New folder\sd\stable-diffusion-webui\venv\lib\site-packages\ffmpeg_run.py", line 284, in run_async
return subprocess.Popen(
File "C:\Users\ASUS TUF GAMING\AppData\Local\Programs\Python\Python310\lib\subprocess.py", line 969, in init
self._execute_child(args, executable, preexec_fn, close_fds,
File "C:\Users\ASUS TUF GAMING\AppData\Local\Programs\Python\Python310\lib\subprocess.py", line 1438, in _execute_child
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] The system cannot find the file specified
Errror while extracting raw frames from source video. Details: [WinError 2] The system cannot find the file specified
Traceback (most recent call last):
File "D:\New folder\sd\stable-diffusion-webui\extensions\sd-webui-deoldify\deoldify\visualize.py", line 251, in _extract_raw_frames
process.run()
File "D:\New folder\sd\stable-diffusion-webui\venv\lib\site-packages\ffmpeg_run.py", line 313, in run
process = run_async(
File "D:\New folder\sd\stable-diffusion-webui\venv\lib\site-packages\ffmpeg_run.py", line 284, in run_async
return subprocess.Popen(
File "C:\Users\ASUS TUF GAMING\AppData\Local\Programs\Python\Python310\lib\subprocess.py", line 969, in init
self._execute_child(args, executable, preexec_fn, close_fds,
File "C:\Users\ASUS TUF GAMING\AppData\Local\Programs\Python\Python310\lib\subprocess.py", line 1438, in _execute_child
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] The system cannot find the file specified
Traceback (most recent call last):
File "D:\New folder\sd\stable-diffusion-webui\venv\lib\site-packages\gradio\routes.py", line 488, in run_predict
output = await app.get_blocks().process_api(
File "D:\New folder\sd\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 1431, in process_api
result = await self.call_function(
File "D:\New folder\sd\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 1103, in call_function
prediction = await anyio.to_thread.run_sync(
File "D:\New folder\sd\stable-diffusion-webui\venv\lib\site-packages\anyio\to_thread.py", line 33, in run_sync
return await get_asynclib().run_sync_in_worker_thread(
File "D:\New folder\sd\stable-diffusion-webui\venv\lib\site-packages\anyio_backends_asyncio.py", line 877, in run_sync_in_worker_thread
return await future
File "D:\New folder\sd\stable-diffusion-webui\venv\lib\site-packages\anyio_backends_asyncio.py", line 807, in run
result = context.run(func, *args)
File "D:\New folder\sd\stable-diffusion-webui\venv\lib\site-packages\gradio\utils.py", line 707, in wrapper
response = f(*args, **kwargs)
File "D:\New folder\sd\stable-diffusion-webui\extensions\sd-webui-deoldify\scripts\ui_deoldify.py", line 28, in process_image
out_video = colorizer.colorize_from_file_name(video_name, render_factor=render_factor,g_process_bar=process)
File "D:\New folder\sd\stable-diffusion-webui\extensions\sd-webui-deoldify\deoldify\visualize.py", line 372, in colorize_from_file_name
return self._colorize_from_path(
File "D:\New folder\sd\stable-diffusion-webui\extensions\sd-webui-deoldify\deoldify\visualize.py", line 384, in _colorize_from_path
self._extract_raw_frames(source_path)
File "D:\New folder\sd\stable-diffusion-webui\extensions\sd-webui-deoldify\deoldify\visualize.py", line 259, in _extract_raw_frames
raise e
File "D:\New folder\sd\stable-diffusion-webui\extensions\sd-webui-deoldify\deoldify\visualize.py", line 251, in _extract_raw_frames
process.run()
File "D:\New folder\sd\stable-diffusion-webui\venv\lib\site-packages\ffmpeg_run.py", line 313, in run
process = run_async(
File "D:\New folder\sd\stable-diffusion-webui\venv\lib\site-packages\ffmpeg_run.py", line 284, in run_async
return subprocess.Popen(
File "C:\Users\ASUS TUF GAMING\AppData\Local\Programs\Python\Python310\lib\subprocess.py", line 969, in init
self._execute_child(args, executable, preexec_fn, close_fds,
File "C:\Users\ASUS TUF GAMING\AppData\Local\Programs\Python\Python310\lib\subprocess.py", line 1438, in _execute_child
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] The system cannot find the file specified

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.