mirror of
https://github.com/lllyasviel/stable-diffusion-webui-forge.git
synced 2026-04-23 15:59:20 +00:00
Cnet (#20)
* ini * i * i * i * i * i * i * Update preprocessor_normalbae.py * i * i * i * i * Update README.md * i * Update preprocessor_depth.py * Update shared.py * Update devices.py * i * i * i * i * i * i * Update README.md * i * Update README.md * i * Update annotator_path.py * i * i * Update preprocessor_meta.py
This commit is contained in:
@@ -76,14 +76,13 @@ class ControlNetExampleForge(scripts.Script):
|
||||
batch_size = p.batch_size
|
||||
|
||||
input_image = cv2.resize(input_image, (width, height))
|
||||
|
||||
# Below are two methods to preprocess images.
|
||||
# Method 1: do it in your own way
|
||||
canny_image = cv2.cvtColor(cv2.Canny(input_image, 100, 200), cv2.COLOR_GRAY2RGB)
|
||||
|
||||
# Method 2: use built-in preprocessor
|
||||
# # Or you can get a list of preprocessors in this way
|
||||
# from modules_forge.shared import shared_preprocessors
|
||||
# canny_image = shared_preprocessors['canny'](input_image, 100, 200)
|
||||
# canny_preprocessor = shared_preprocessors['canny']
|
||||
# canny_image = canny_preprocessor(
|
||||
# input_image, resolution=512, slider_1=100, slider_2=200, slider_3=None)
|
||||
|
||||
# Output preprocessor result. Now called every sampling. Cache in your own way.
|
||||
p.extra_result_images.append(canny_image)
|
||||
|
||||
Reference in New Issue
Block a user