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.sh
|
||||
|
||||
# this may be present if the user created a venv
|
||||
invokeai
|
||||
|
||||
# no longer stored in source directory
|
||||
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
|
||||
|
||||
import eventlet
|
||||
from pathlib import Path
|
||||
from PIL import Image
|
||||
from PIL.Image import Image as ImageType
|
||||
from flask import Flask, redirect, send_from_directory, request, make_response
|
||||
from flask_socketio import SocketIO
|
||||
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,
|
||||
)
|
||||
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.invoke.args import Args, APP_ID, APP_VERSION, calculate_init_img_hash
|
||||
from ldm.invoke.conditioning import get_tokens_for_prompt, get_prompt_structure
|
||||
@ -254,16 +256,14 @@ class InvokeAIWebServer:
|
||||
)
|
||||
|
||||
def find_frontend(self):
|
||||
my_dir = os.path.dirname(__file__)
|
||||
# LS: setup.py seems to put the frontend in different places on different systems, so
|
||||
# this is fragile and needs to be replaced with a better way of finding the front end.
|
||||
for candidate in (os.path.join(my_dir,'..','frontend','dist'), # pip install -e .
|
||||
os.path.join(my_dir,'../../../../frontend','dist'), # pip install . (Linux, Mac)
|
||||
os.path.join(my_dir,'../../../frontend','dist'), # pip install . (Windows)
|
||||
):
|
||||
if os.path.exists(candidate):
|
||||
return candidate
|
||||
assert "Frontend files cannot be found. Cannot continue"
|
||||
for candidate in [
|
||||
*frontend.__path__,
|
||||
Path(__file__).parent / '..' / 'frontend'
|
||||
]:
|
||||
path = Path(candidate,'dist')
|
||||
if path.exists():
|
||||
return path
|
||||
assert path.exists(),"Frontend files cannot be found. Cannot continue"
|
||||
|
||||
def setup_app(self):
|
||||
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
|
||||
|
||||
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 |