mirror of
https://github.com/vladmandic/automatic
synced 2026-09-19 17:24:32 +02:00
improve support for manually downloaded controlnets
This commit is contained in:
@@ -69,14 +69,19 @@ cache_dir = 'models/control/controlnet'
|
||||
def find_models():
|
||||
path = os.path.join(opts.control_dir, 'controlnet')
|
||||
files = listdir(path)
|
||||
folders = [f for f in files if os.path.isdir(f) if os.path.exists(os.path.join(f, 'config.json'))]
|
||||
files = [f for f in files if f.endswith('.safetensors')]
|
||||
downloaded_models = {}
|
||||
for f in files:
|
||||
basename = os.path.splitext(os.path.relpath(f, path))[0]
|
||||
downloaded_models[basename] = os.path.join(path, f)
|
||||
for f in folders:
|
||||
basename = os.path.relpath(f, path)
|
||||
downloaded_models[basename] = f
|
||||
all_models.update(downloaded_models)
|
||||
return downloaded_models
|
||||
|
||||
find_models()
|
||||
|
||||
def list_models(refresh=False):
|
||||
import modules.shared
|
||||
|
||||
+4
-1
@@ -975,7 +975,10 @@ if cmd_opts.use_xformers:
|
||||
opts.data['uni_pc_lower_order_final'] = opts.schedulers_use_loworder # compatibility
|
||||
opts.data['uni_pc_order'] = opts.schedulers_solver_order # compatibility
|
||||
log.info(f'Engine: backend={backend} compute={devices.backend} device={devices.get_optimal_device_name()} attention="{opts.cross_attention_optimization}" mode={devices.inference_context.__name__}')
|
||||
log.info(f'Device: {print_dict(devices.get_gpu_info())}')
|
||||
try:
|
||||
log.info(f'Device: {print_dict(devices.get_gpu_info())}')
|
||||
except Exception as ex:
|
||||
log.error(f'Device: {ex}')
|
||||
|
||||
prompt_styles = modules.styles.StyleDatabase(opts)
|
||||
reference_models = readfile(os.path.join('html', 'reference.json'))
|
||||
|
||||
Reference in New Issue
Block a user