mirror of
https://github.com/lllyasviel/stable-diffusion-webui-forge.git
synced 2026-04-27 01:38:53 +00:00
Forge Space and BiRefNet
This commit is contained in:
@@ -5,6 +5,7 @@ import dataclasses
|
||||
import os
|
||||
import threading
|
||||
import re
|
||||
import json
|
||||
|
||||
from modules import shared, errors, cache, scripts
|
||||
from modules.gitpython_hack import Repo
|
||||
@@ -124,6 +125,13 @@ class Extension:
|
||||
self.metadata = metadata if metadata else ExtensionMetadata(self.path, name.lower())
|
||||
self.canonical_name = metadata.canonical_name
|
||||
|
||||
self.is_forge_space = False
|
||||
self.space_meta = None
|
||||
|
||||
if os.path.exists(os.path.join(self.path, 'space_meta.json')) and os.path.exists(os.path.join(self.path, 'forge_app.py')):
|
||||
self.is_forge_space = True
|
||||
self.space_meta = json.load(open(os.path.join(self.path, 'space_meta.json'), 'rt', encoding='utf-8'))
|
||||
|
||||
def to_dict(self):
|
||||
return {x: getattr(self, x) for x in self.cached_fields}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user