support for wheel building; webserver broken

This commit is contained in:
Lincoln Stein 2022-11-18 03:21:07 +00:00
parent fdb16000ab
commit 8973ce7d47
3 changed files with 15 additions and 522 deletions

View File

@ -17,6 +17,7 @@ from threading import Event
from ldm.invoke.args import Args, APP_ID, APP_VERSION, calculate_init_img_hash
from ldm.invoke.pngwriter import PngWriter, retrieve_metadata
from ldm.invoke.prompt_parser import split_weighted_subprompts
from ldm.invoke.globals import Globals
from backend.modules.parameters import parameters_to_command
@ -25,7 +26,6 @@ from backend.modules.parameters import parameters_to_command
opt = Args()
args = opt.parse_args()
class InvokeAIWebServer:
def __init__(self, generate, gfpgan, codeformer, esrgan) -> None:
self.host = args.host
@ -74,6 +74,8 @@ class InvokeAIWebServer:
return {"message": "Server Running"}
# Outputs Route
if not os.path.isabs(args.outdir):
args.outdir=os.path.join(Globals.root,args.outdir)
self.app.config["OUTPUTS_FOLDER"] = os.path.abspath(args.outdir)
@self.app.route("/outputs/<path:file_path>")

File diff suppressed because one or more lines are too long

View File

@ -1,22 +1,16 @@
from setuptools import setup, find_packages
from setuptools.command.develop import develop
from setuptools.command.install import install
import os
class PostDevelopCommand(develop):
"""Post-installation for development mode."""
def run(self):
develop.run(self)
print('Will now try loading a module (develop)')
import ldm.generate
print('ldm.generate loaded ok')
def frontend_files(directory):
paths = []
for (path, directories, filenames) in os.walk(directory):
for filename in filenames:
paths.append(os.path.join(path, filename))
return paths
frontend_files = frontend_files('frontend/dist')
print(f'DEBUG: {frontend_files}')
class PostInstallCommand(install):
"""Post-installation for installation mode."""
def run(self):
install.run(self)
print('Will now try loading a module (install)')
import ldm.generate
print('ldm.generate loaded ok')
setup(
name='invoke-ai',
@ -28,9 +22,7 @@ setup(
'numpy',
'tqdm',
],
cmdclass={
'develop': PostDevelopCommand,
'install': PostInstallCommand,
},
scripts = ['scripts/invoke.py','scripts/load_models.py','scripts/sd-metadata.py'],
data_files=[('frontend',frontend_files)],
)