mirror of
https://github.com/lllyasviel/stable-diffusion-webui-forge.git
synced 2026-02-24 08:43:57 +00:00
i
This commit is contained in:
@@ -78,6 +78,17 @@ class ControlNetExampleForge(scripts.Script):
|
||||
input_image = cv2.resize(input_image, (width, height))
|
||||
canny_image = cv2.cvtColor(cv2.Canny(input_image, 100, 200), cv2.COLOR_GRAY2RGB)
|
||||
|
||||
from modules_forge.ops import capture_model
|
||||
from modules_forge.shared import shared_preprocessors
|
||||
|
||||
with capture_model() as captured_model:
|
||||
canny_image = shared_preprocessors['normalbae'](input_image, 512)
|
||||
|
||||
captured_model.cpu()
|
||||
from ldm_patched.modules import model_management
|
||||
model_management.soft_empty_cache()
|
||||
a = 0
|
||||
|
||||
# # Or you can get a list of preprocessors in this way
|
||||
# from modules_forge.shared import shared_preprocessors
|
||||
# canny_preprocessor = shared_preprocessors['canny']
|
||||
|
||||
Reference in New Issue
Block a user