mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
Merge branch 'main' into security/scan-ckpt-files-main
This commit is contained in:
commit
deeff36e16
@ -154,6 +154,7 @@ class InvokeAIGenerator(metaclass=ABCMeta):
|
|||||||
for i in iteration_count:
|
for i in iteration_count:
|
||||||
results = generator.generate(prompt,
|
results = generator.generate(prompt,
|
||||||
conditioning=(uc, c, extra_conditioning_info),
|
conditioning=(uc, c, extra_conditioning_info),
|
||||||
|
step_callback=step_callback,
|
||||||
sampler=scheduler,
|
sampler=scheduler,
|
||||||
**generator_args,
|
**generator_args,
|
||||||
)
|
)
|
||||||
|
@ -362,6 +362,7 @@ class ModelManager(object):
|
|||||||
raise NotImplementedError(
|
raise NotImplementedError(
|
||||||
f"Unknown model format {model_name}: {model_format}"
|
f"Unknown model format {model_name}: {model_format}"
|
||||||
)
|
)
|
||||||
|
self._add_embeddings_to_model(model)
|
||||||
|
|
||||||
# usage statistics
|
# usage statistics
|
||||||
toc = time.time()
|
toc = time.time()
|
||||||
@ -434,10 +435,9 @@ class ModelManager(object):
|
|||||||
# square images???
|
# square images???
|
||||||
width = pipeline.unet.config.sample_size * pipeline.vae_scale_factor
|
width = pipeline.unet.config.sample_size * pipeline.vae_scale_factor
|
||||||
height = width
|
height = width
|
||||||
|
|
||||||
print(f" | Default image dimensions = {width} x {height}")
|
print(f" | Default image dimensions = {width} x {height}")
|
||||||
self._add_embeddings_to_model(pipeline)
|
|
||||||
|
|
||||||
|
self._add_embeddings_to_model(pipeline)
|
||||||
return pipeline, width, height, model_hash
|
return pipeline, width, height, model_hash
|
||||||
|
|
||||||
def _load_ckpt_model(self, model_name, mconfig):
|
def _load_ckpt_model(self, model_name, mconfig):
|
||||||
|
@ -6,7 +6,6 @@ The interface is through the Concepts() object.
|
|||||||
"""
|
"""
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
import traceback
|
|
||||||
from typing import Callable
|
from typing import Callable
|
||||||
from urllib import error as ul_error
|
from urllib import error as ul_error
|
||||||
from urllib import request
|
from urllib import request
|
||||||
@ -15,7 +14,6 @@ from huggingface_hub import (
|
|||||||
HfApi,
|
HfApi,
|
||||||
HfFolder,
|
HfFolder,
|
||||||
ModelFilter,
|
ModelFilter,
|
||||||
ModelSearchArguments,
|
|
||||||
hf_hub_url,
|
hf_hub_url,
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -84,7 +82,7 @@ class HuggingFaceConceptsLibrary(object):
|
|||||||
"""
|
"""
|
||||||
if not concept_name in self.list_concepts():
|
if not concept_name in self.list_concepts():
|
||||||
print(
|
print(
|
||||||
f"This concept is not a local embedding trigger, nor is it a HuggingFace concept. Generation will continue without the concept."
|
f"{concept_name} is not a local embedding trigger, nor is it a HuggingFace concept. Generation will continue without the concept."
|
||||||
)
|
)
|
||||||
return None
|
return None
|
||||||
return self.get_concept_file(concept_name.lower(), "learned_embeds.bin")
|
return self.get_concept_file(concept_name.lower(), "learned_embeds.bin")
|
||||||
@ -236,7 +234,7 @@ class HuggingFaceConceptsLibrary(object):
|
|||||||
except ul_error.HTTPError as e:
|
except ul_error.HTTPError as e:
|
||||||
if e.code == 404:
|
if e.code == 404:
|
||||||
print(
|
print(
|
||||||
f"This concept is not known to the Hugging Face library. Generation will continue without the concept."
|
f"Concept {concept_name} is not known to the Hugging Face library. Generation will continue without the concept."
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
print(
|
print(
|
||||||
@ -246,7 +244,7 @@ class HuggingFaceConceptsLibrary(object):
|
|||||||
return False
|
return False
|
||||||
except ul_error.URLError as e:
|
except ul_error.URLError as e:
|
||||||
print(
|
print(
|
||||||
f"ERROR: {str(e)}. This may reflect a network issue. Generation will continue without the concept."
|
f"ERROR while downloading {concept_name}: {str(e)}. This may reflect a network issue. Generation will continue without the concept."
|
||||||
)
|
)
|
||||||
os.rmdir(dest)
|
os.rmdir(dest)
|
||||||
return False
|
return False
|
||||||
|
@ -38,7 +38,7 @@ dependencies = [
|
|||||||
"albumentations",
|
"albumentations",
|
||||||
"click",
|
"click",
|
||||||
"clip_anytorch", # replacing "clip @ https://github.com/openai/CLIP/archive/eaa22acb90a5876642d0507623e859909230a52d.zip",
|
"clip_anytorch", # replacing "clip @ https://github.com/openai/CLIP/archive/eaa22acb90a5876642d0507623e859909230a52d.zip",
|
||||||
"compel==1.0.1",
|
"compel==1.0.4",
|
||||||
"datasets",
|
"datasets",
|
||||||
"diffusers[torch]~=0.14",
|
"diffusers[torch]~=0.14",
|
||||||
"dnspython==2.2.1",
|
"dnspython==2.2.1",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user