mirror of
https://github.com/lllyasviel/stable-diffusion-webui-forge.git
synced 2026-04-28 18:21:48 +00:00
Add optimization --cuda-stream
See also the readme for more details
This commit is contained in:
@@ -59,6 +59,9 @@ def initialize_forge():
|
||||
import modules_forge.patch_basic
|
||||
modules_forge.patch_basic.patch_all_basics()
|
||||
|
||||
from modules_forge import stream
|
||||
print('CUDA Stream Activated: ', stream.using_stream)
|
||||
|
||||
from modules_forge.shared import diffusers_dir
|
||||
|
||||
if 'TRANSFORMERS_CACHE' not in os.environ:
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
import torch
|
||||
|
||||
from modules import shared
|
||||
from ldm_patched.modules import args_parser
|
||||
from ldm_patched.modules import model_management
|
||||
|
||||
|
||||
@@ -56,14 +56,12 @@ def get_new_stream():
|
||||
return None
|
||||
|
||||
|
||||
if shared.opts.use_non_streamlined_lowvram:
|
||||
current_stream = None
|
||||
mover_stream = None
|
||||
using_stream = False
|
||||
else:
|
||||
current_stream = None
|
||||
mover_stream = None
|
||||
using_stream = False
|
||||
|
||||
if args_parser.args.cuda_stream:
|
||||
current_stream = get_current_stream()
|
||||
mover_stream = get_new_stream()
|
||||
using_stream = current_stream is not None and mover_stream is not None
|
||||
|
||||
if not using_stream:
|
||||
print('Stream is not used.')
|
||||
|
||||
Reference in New Issue
Block a user