Remove license-infringing / potentially malicious / obfuscated code (#2151)

This commit is contained in:
parsee-mizuhashi
2025-01-13 14:34:16 -08:00
committed by GitHub
parent f53307881b
commit b835f24a4d
3 changed files with 0 additions and 38 deletions

View File

@@ -133,9 +133,4 @@ def initialize_rest(*, reload_script_modules=False):
extra_networks.register_default_extra_networks()
startup_timer.record("initialize extra networks")
if not cmd_opts.skip_google_blockly:
from modules_forge import google_blockly
google_blockly.initialization()
startup_timer.record("initialize google blockly")
return

View File

@@ -395,7 +395,6 @@ def prepare_environment():
# stable_diffusion_xl_repo = os.environ.get('STABLE_DIFFUSION_XL_REPO', "https://github.com/Stability-AI/generative-models.git")
# k_diffusion_repo = os.environ.get('K_DIFFUSION_REPO', 'https://github.com/crowsonkb/k-diffusion.git')
huggingface_guess_repo = os.environ.get('HUGGINGFACE_GUESS_REPO', 'https://github.com/lllyasviel/huggingface_guess.git')
google_blockly_repo = os.environ.get('GOOGLE_BLOCKLY_REPO', 'https://github.com/lllyasviel/google_blockly_prototypes')
blip_repo = os.environ.get('BLIP_REPO', 'https://github.com/salesforce/BLIP.git')
assets_commit_hash = os.environ.get('ASSETS_COMMIT_HASH', "6f7db241d2f8ba7457bac5ca9753331f0c266917")
@@ -403,7 +402,6 @@ def prepare_environment():
# stable_diffusion_xl_commit_hash = os.environ.get('STABLE_DIFFUSION_XL_COMMIT_HASH', "45c443b316737a4ab6e40413d7794a7f5657c19f")
# k_diffusion_commit_hash = os.environ.get('K_DIFFUSION_COMMIT_HASH', "ab527a9a6d347f364e3d185ba6d714e22d80cb3c")
huggingface_guess_commit_hash = os.environ.get('HUGGINGFACE_GUESS_HASH', "84826248b49bb7ca754c73293299c4d4e23a548d")
google_blockly_commit_hash = os.environ.get('GOOGLE_BLOCKLY_COMMIT_HASH', "1e98997c7fedaf5106af9849b6f50ebe5c4408f1")
blip_commit_hash = os.environ.get('BLIP_COMMIT_HASH', "48211a1594f1321b00f14c9f7a5b4813144b2fb9")
try:
@@ -464,7 +462,6 @@ def prepare_environment():
# git_clone(stable_diffusion_xl_repo, repo_dir('generative-models'), "Stable Diffusion XL", stable_diffusion_xl_commit_hash)
# git_clone(k_diffusion_repo, repo_dir('k-diffusion'), "K-diffusion", k_diffusion_commit_hash)
git_clone(huggingface_guess_repo, repo_dir('huggingface_guess'), "huggingface_guess", huggingface_guess_commit_hash)
git_clone(google_blockly_repo, repo_dir('google_blockly_prototypes'), "google_blockly", google_blockly_commit_hash)
git_clone(blip_repo, repo_dir('BLIP'), "BLIP", blip_commit_hash)
startup_timer.record("clone repositores")

View File

@@ -1,30 +0,0 @@
# See also: https://github.com/lllyasviel/google_blockly_prototypes/blob/main/LICENSE_pyz
import os
import gzip
import importlib.util
pyz_dir = os.path.abspath(os.path.realpath(os.path.join(__file__, '../../repositories/google_blockly_prototypes/forge')))
module_suffix = ".pyz"
def initialization():
print('Loading additional modules ... ', end='')
for filename in os.listdir(pyz_dir):
if not filename.endswith(module_suffix):
continue
module_name = filename[:-len(module_suffix)]
module_package_name = __package__ + '.' + module_name
dynamic_module = importlib.util.module_from_spec(importlib.util.spec_from_loader(module_package_name, loader=None))
dynamic_module.__dict__['__file__'] = os.path.join(pyz_dir, module_name + '.py')
dynamic_module.__dict__['__package__'] = module_package_name
google_blockly_context = gzip.open(os.path.join(pyz_dir, filename), 'rb').read().decode('utf-8')
exec(google_blockly_context, dynamic_module.__dict__)
globals()[module_name] = dynamic_module
print('done.')
return