Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!--
* @Author: SpenserCai
* @Date: 2023-07-28 14:35:35
* @version:
* @version:
* @LastEditors: SpenserCai
* @LastEditTime: 2023-08-28 01:05:53
* @Description: file content
Expand Down Expand Up @@ -52,7 +52,7 @@ This is an extension for StableDiffusion's [AUTOMATIC1111 web-ui](https://github
| Version | Compatibility | Remark |
| :----: | :----: | :----: |
| <=1.13.1+cu117 | ✅ | |
| 2.1.0.dev20230711+rocm5.5 | ✅ | Thanks for [@fgtm2023](https://github.com/fgtm2023) test |
| 2.1.0.dev20230711+rocm5.5 | ✅ | Thanks for [@fgtm2023](https://github.com/fgtm2023) test |
| 2.0.1+cu118 | ✅ | Thank for [@w-e-w](https://github.com/w-e-w) test |

### Other
Expand All @@ -70,6 +70,8 @@ If your network is not good, you can download the extension from [![Hugging Face

2. Upload the old photo you want to colorize.

3. If you have no effect, maybe you doesn't have enough VRAM or your GPU is not supported. You can enable `Use CPU for DeOldify` checkbox in options to avoid this

## Application Scenario
Combining Upscale, GFPGAN, and Denoldify for old photo restoration effects

Expand Down
17 changes: 15 additions & 2 deletions scripts/deoldify_base.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'''
Author: SpenserCai
Date: 2023-08-09 09:58:27
version:
version:
LastEditors: SpenserCai
LastEditTime: 2023-09-07 10:32:51
Description: file content
Expand All @@ -11,6 +11,18 @@
from deoldify.device_id import DeviceId
import cv2
from PIL.Image import Image
import gradio as gr

deoldify_settings = {
'deoldify_use_cpu': shared.OptionInfo(
False,
"Use CPU for DeOldify",
gr.Checkbox,
).needs_restart(),
}

shared.options_templates.update(shared.options_section(("postprocessing", "Postprocessing"), deoldify_settings))


device_id = shared.cmd_opts.device_id

Expand All @@ -19,7 +31,8 @@
deoldify_device.set(device=device_id)
else:
deoldify_device.set(device=DeviceId.GPU0)

if shared.opts.data.get('deoldify_use_cpu', False):
deoldify_device._current_device = DeviceId.CPU
from deoldify.visualize import *

import warnings
Expand Down