Various fixes
1) Downgrade numpy to avoid dependency conflict with numba 2) Move all non ldm/invoke files into `invokeai`. This includes assets, backend, frontend, and configs. 3) Fix up way that the backend finds the frontend and the generator finds the NSFW caution.png icon.
3
.gitignore
vendored
@ -231,8 +231,5 @@ installer/install.sh
|
|||||||
installer/update.bat
|
installer/update.bat
|
||||||
installer/update.sh
|
installer/update.sh
|
||||||
|
|
||||||
# this may be present if the user created a venv
|
|
||||||
invokeai
|
|
||||||
|
|
||||||
# no longer stored in source directory
|
# no longer stored in source directory
|
||||||
models
|
models
|
3
invokeai/README
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
After version 2.3 is released, the ldm/invoke modules will be migrated to this location
|
||||||
|
so that we have a proper invokeai distribution. Currently it is only being used for
|
||||||
|
data files.
|
Before Width: | Height: | Size: 651 KiB After Width: | Height: | Size: 651 KiB |
Before Width: | Height: | Size: 596 KiB After Width: | Height: | Size: 596 KiB |
Before Width: | Height: | Size: 609 KiB After Width: | Height: | Size: 609 KiB |
Before Width: | Height: | Size: 548 KiB After Width: | Height: | Size: 548 KiB |
Before Width: | Height: | Size: 705 KiB After Width: | Height: | Size: 705 KiB |
Before Width: | Height: | Size: 757 KiB After Width: | Height: | Size: 757 KiB |
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 466 KiB After Width: | Height: | Size: 466 KiB |
Before Width: | Height: | Size: 7.4 KiB After Width: | Height: | Size: 7.4 KiB |
Before Width: | Height: | Size: 539 KiB After Width: | Height: | Size: 539 KiB |
Before Width: | Height: | Size: 7.6 KiB After Width: | Height: | Size: 7.6 KiB |
Before Width: | Height: | Size: 450 KiB After Width: | Height: | Size: 450 KiB |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 553 KiB After Width: | Height: | Size: 553 KiB |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 418 KiB After Width: | Height: | Size: 418 KiB |
Before Width: | Height: | Size: 6.1 KiB After Width: | Height: | Size: 6.1 KiB |
Before Width: | Height: | Size: 542 KiB After Width: | Height: | Size: 542 KiB |
Before Width: | Height: | Size: 9.5 KiB After Width: | Height: | Size: 9.5 KiB |
Before Width: | Height: | Size: 395 KiB After Width: | Height: | Size: 395 KiB |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 465 KiB After Width: | Height: | Size: 465 KiB |
Before Width: | Height: | Size: 7.8 KiB After Width: | Height: | Size: 7.8 KiB |
Before Width: | Height: | Size: 612 KiB After Width: | Height: | Size: 612 KiB |
Before Width: | Height: | Size: 312 KiB After Width: | Height: | Size: 312 KiB |
Before Width: | Height: | Size: 72 KiB After Width: | Height: | Size: 72 KiB |
Before Width: | Height: | Size: 319 KiB After Width: | Height: | Size: 319 KiB |
Before Width: | Height: | Size: 788 KiB After Width: | Height: | Size: 788 KiB |
Before Width: | Height: | Size: 958 KiB After Width: | Height: | Size: 958 KiB |
Before Width: | Height: | Size: 9.4 MiB After Width: | Height: | Size: 9.4 MiB |
Before Width: | Height: | Size: 610 KiB After Width: | Height: | Size: 610 KiB |
Before Width: | Height: | Size: 1.1 MiB After Width: | Height: | Size: 1.1 MiB |
Before Width: | Height: | Size: 1.3 MiB After Width: | Height: | Size: 1.3 MiB |
Before Width: | Height: | Size: 945 KiB After Width: | Height: | Size: 945 KiB |
Before Width: | Height: | Size: 972 KiB After Width: | Height: | Size: 972 KiB |
Before Width: | Height: | Size: 662 KiB After Width: | Height: | Size: 662 KiB |
Before Width: | Height: | Size: 302 KiB After Width: | Height: | Size: 302 KiB |
Before Width: | Height: | Size: 2.2 MiB After Width: | Height: | Size: 2.2 MiB |
Before Width: | Height: | Size: 33 KiB After Width: | Height: | Size: 33 KiB |
5
invokeai/backend/__init__.py
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
'''
|
||||||
|
Initialization file for invokeai.backend
|
||||||
|
'''
|
||||||
|
from .invoke_ai_web_server import InvokeAIWebServer
|
||||||
|
|
@ -11,16 +11,18 @@ from threading import Event
|
|||||||
from uuid import uuid4
|
from uuid import uuid4
|
||||||
|
|
||||||
import eventlet
|
import eventlet
|
||||||
|
from pathlib import Path
|
||||||
from PIL import Image
|
from PIL import Image
|
||||||
from PIL.Image import Image as ImageType
|
from PIL.Image import Image as ImageType
|
||||||
from flask import Flask, redirect, send_from_directory, request, make_response
|
from flask import Flask, redirect, send_from_directory, request, make_response
|
||||||
from flask_socketio import SocketIO
|
from flask_socketio import SocketIO
|
||||||
from werkzeug.utils import secure_filename
|
from werkzeug.utils import secure_filename
|
||||||
|
|
||||||
from backend.modules.get_canvas_generation_mode import (
|
from invokeai.backend.modules.get_canvas_generation_mode import (
|
||||||
get_canvas_generation_mode,
|
get_canvas_generation_mode,
|
||||||
)
|
)
|
||||||
from backend.modules.parameters import parameters_to_command
|
from invokeai.backend.modules.parameters import parameters_to_command
|
||||||
|
from invokeai import frontend
|
||||||
from ldm.generate import Generate
|
from ldm.generate import Generate
|
||||||
from ldm.invoke.args import Args, APP_ID, APP_VERSION, calculate_init_img_hash
|
from ldm.invoke.args import Args, APP_ID, APP_VERSION, calculate_init_img_hash
|
||||||
from ldm.invoke.conditioning import get_tokens_for_prompt, get_prompt_structure
|
from ldm.invoke.conditioning import get_tokens_for_prompt, get_prompt_structure
|
||||||
@ -254,16 +256,14 @@ class InvokeAIWebServer:
|
|||||||
)
|
)
|
||||||
|
|
||||||
def find_frontend(self):
|
def find_frontend(self):
|
||||||
my_dir = os.path.dirname(__file__)
|
for candidate in [
|
||||||
# LS: setup.py seems to put the frontend in different places on different systems, so
|
*frontend.__path__,
|
||||||
# this is fragile and needs to be replaced with a better way of finding the front end.
|
Path(__file__).parent / '..' / 'frontend'
|
||||||
for candidate in (os.path.join(my_dir,'..','frontend','dist'), # pip install -e .
|
]:
|
||||||
os.path.join(my_dir,'../../../../frontend','dist'), # pip install . (Linux, Mac)
|
path = Path(candidate,'dist')
|
||||||
os.path.join(my_dir,'../../../frontend','dist'), # pip install . (Windows)
|
if path.exists():
|
||||||
):
|
return path
|
||||||
if os.path.exists(candidate):
|
assert path.exists(),"Frontend files cannot be found. Cannot continue"
|
||||||
return candidate
|
|
||||||
assert "Frontend files cannot be found. Cannot continue"
|
|
||||||
|
|
||||||
def setup_app(self):
|
def setup_app(self):
|
||||||
self.result_url = "outputs/"
|
self.result_url = "outputs/"
|
@ -1,4 +1,4 @@
|
|||||||
from backend.modules.parse_seed_weights import parse_seed_weights
|
from invokeai.backend.modules.parse_seed_weights import parse_seed_weights
|
||||||
import argparse
|
import argparse
|
||||||
|
|
||||||
SAMPLER_CHOICES = [
|
SAMPLER_CHOICES = [
|
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 2.7 KiB |
Before Width: | Height: | Size: 292 KiB After Width: | Height: | Size: 292 KiB |
Before Width: | Height: | Size: 164 KiB After Width: | Height: | Size: 164 KiB |
Before Width: | Height: | Size: 9.5 KiB After Width: | Height: | Size: 9.5 KiB |
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 3.4 KiB |
Before Width: | Height: | Size: 116 KiB After Width: | Height: | Size: 116 KiB |
Before Width: | Height: | Size: 43 KiB After Width: | Height: | Size: 43 KiB |