Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
8 changes: 4 additions & 4 deletions .github/workflows/lint-frontend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
node-version: '18'
- uses: actions/checkout@v3
- run: 'yarn install --frozen-lockfile'
- run: 'yarn run lint:tsc'
- run: 'yarn run lint:madge'
- run: 'yarn run lint:eslint'
- run: 'yarn run lint:prettier'
- run: 'yarn tsc'
- run: 'yarn run madge'
- run: 'yarn run lint --max-warnings=0'
- run: 'yarn run prettier --check'
40 changes: 21 additions & 19 deletions invokeai/backend/model_management/model_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -333,10 +333,23 @@ def _load_model(self, model_name: str):

tic = time.time()

with warnings.catch_warnings():
warnings.simplefilter("ignore")
model, width, height, model_hash = self._load_diffusers_model(mconfig)

# this does the work
model_format = mconfig.get("format", "ckpt")
if model_format == "ckpt":
weights = mconfig.weights
print(f">> Loading {model_name} from {weights}")
model, width, height, model_hash = self._load_ckpt_model(
model_name, mconfig
)
elif model_format == "diffusers":
with warnings.catch_warnings():
warnings.simplefilter("ignore")
model, width, height, model_hash = self._load_diffusers_model(mconfig)
else:
raise NotImplementedError(
f"Unknown model format {model_name}: {model_format}"
)

# usage statistics
toc = time.time()
print(">> Model loaded in", "%4.2fs" % (toc - tic))
Expand Down Expand Up @@ -928,7 +941,7 @@ def migrate_models(cls):
"openai/clip-vit-large-patch14/models--openai--clip-vit-large-patch14"
),
]
legacy_locations.extend(list(global_cache_dir("diffusers").glob('*')))
legacy_locations.extend(list(Path(models_dir,"diffusers").glob('*')))

legacy_layout = False
for model in legacy_locations:
Expand All @@ -937,17 +950,9 @@ def migrate_models(cls):
return

print(
"""
>> ALERT:
>> The location of your previously-installed diffusers models needs to move from
>> invokeai/models/diffusers to invokeai/models/hub due to a change introduced by
>> diffusers version 0.14. InvokeAI will now move all models from the "diffusers" directory
>> into "hub" and then remove the diffusers directory. This is a quick, safe, one-time
>> operation. However if you have customized either of these directories and need to
>> make adjustments, please press ctrl-C now to abort and relaunch InvokeAI when you are ready.
>> Otherwise press <enter> to continue."""
"** Old model directory layout (< v3.0) detected. Reorganizing."
)
input('continue> ')
print("** This is a quick one-time operation.")

# transformer files get moved into the hub directory
if cls._is_huggingface_hub_directory_present():
Expand All @@ -966,10 +971,7 @@ def migrate_models(cls):
if dest.is_symlink():
print(f"** Found symlink at {dest.name}. Not migrating.")
elif dest.exists():
if source.is_dir():
rmtree(source)
else:
source.unlink()
rmtree(source)
else:
move(source, dest)

Expand Down
3 changes: 0 additions & 3 deletions invokeai/frontend/web/.eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,3 @@ dist/
node_modules/
patches/
stats.html
index.html
.yarn/
*.scss
5 changes: 1 addition & 4 deletions invokeai/frontend/web/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,7 @@ module.exports = {
radix: 'error',
'space-before-blocks': 'error',
'import/prefer-default-export': 'off',
'@typescript-eslint/no-unused-vars': [
'warn',
{ varsIgnorePattern: '^_', argsIgnorePattern: '^_' },
],
'@typescript-eslint/no-unused-vars': ['warn', { varsIgnorePattern: '_+' }],
'prettier/prettier': ['error', { endOfLine: 'auto' }],
},
settings: {
Expand Down
2 changes: 1 addition & 1 deletion invokeai/frontend/web/.husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

cd invokeai/frontend/web/ && npm run lint-staged
cd invokeai/frontend/ && npm run lint-staged
1 change: 0 additions & 1 deletion invokeai/frontend/web/.prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,3 @@ dist/
node_modules/
patches/
stats.html
.yarn/
1 change: 0 additions & 1 deletion invokeai/frontend/web/.prettierrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ module.exports = {
tabWidth: 2,
semi: true,
singleQuote: true,
endOfLine: 'auto',
overrides: [
{
files: ['public/locales/*.json'],
Expand Down
3 changes: 3 additions & 0 deletions invokeai/frontend/web/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
'''
Initialization file for invokeai.frontend.web
'''
1 change: 0 additions & 1 deletion invokeai/frontend/web/dist/assets/App-06f6cac1.css

This file was deleted.

Loading