More fixes for pipelines, progress, JIT schedulers, versioning

This commit is contained in:
Ean Garvey
2024-06-20 01:00:51 -05:00
parent f092ebddd2
commit 80dc688467
4 changed files with 10 additions and 13 deletions

View File

@@ -164,8 +164,7 @@ class StableDiffusion:
devices = backend
targets = target
max_length = 64
self.pipe_id = "_".join(pipe_id_list)
self.pipeline_dir = Path(os.path.join(get_checkpoints_path(), "vmfbs"))
self.weights_path = Path(os.path.join(get_checkpoints_path(), "weights"))
if not os.path.exists(self.pipeline_dir):
@@ -348,18 +347,13 @@ def shark_sd_fn_dict_input(sd_kwargs: dict, *, progress=gr.Progress()):
if not sd_kwargs["device"]:
gr.Warning("No device specified. Please specify a device.")
return None, ""
if sd_kwargs["height"] != 512 and sd_kwargs["width"] != 512 and sd_kwargs["base_model_id"] == "stabilityai/sdxl-turbo":
gr.Warning("SDXL turbo output size must be 512x512. This is a temporary limitation.")
return None, ""
if sd_kwargs["base_model_id"] == "stabilityai/sdxl-turbo":
if sd_kwargs["steps"] > 10:
gr.Warning("Max steps for sdxl-turbo is 10. 1 to 4 steps are recommended.")
return None, ""
gr.Warning("1 to 4 steps are recommended for sdxl-turbo, unless you are using a custom checkpoint.")
if sd_kwargs["guidance_scale"] > 3:
gr.Warning(
"sdxl-turbo CFG scale should be less than 2.0 if using negative prompt, 0 otherwise."
"sdxl-turbo CFG scale should be between 1.0 and 2.0 if using negative prompt, 0 otherwise."
)
return None, ""
if sd_kwargs["target_triple"] == "":
if not parse_device(sd_kwargs["device"], sd_kwargs["target_triple"])[1]:
gr.Warning(

View File

@@ -65,7 +65,10 @@ def preprocessCKPT(custom_weights, precision="fp16", is_inpaint=False):
def save_irpa(weights_path, prepend_str, remove_str=None):
weights = safetensors.torch.load_file(weights_path)
try:
weights = safetensors.torch.load_file(weights_path)
except:
weights = safetensors.numpy.load_file(weights_path)
archive = ParameterArchiveBuilder()
for key in weights.keys():
if remove_str:

View File

@@ -6,7 +6,7 @@ setuptools
wheel
torch>=2.3.0
torch>2.4.1
shark-turbine @ git+https://github.com/iree-org/iree-turbine.git@main
turbine-models @ git+https://github.com/nod-ai/SHARK-Turbine.git@ean-unify-sd#subdirectory=models
diffusers @ git+https://github.com/nod-ai/diffusers@0.29.0.dev0-shark
@@ -29,7 +29,7 @@ parameterized
#accelerate is now required for diffusers import from ckpt.
accelerate
scipy
transformers==4.37.1
transformers
torchsde # Required for Stable Diffusion SDE schedulers.
ftfy
gradio==4.29.0

View File

@@ -89,7 +89,7 @@ else {python -m venv .\shark.venv\}
python -m pip install --upgrade pip
pip install wheel
pip install --pre -r requirements.txt
pip install https://github.com/nod-ai/SRT/releases/download/candidate-20240617.289/iree_compiler-20240617.289-cp311-cp311-win_amd64.whl https://github.com/nod-ai/SRT/releases/download/candidate-20240617.289/iree_runtime-20240617.289-cp311-cp311-win_amd64.whl
pip install https://github.com/nod-ai/SRT/releases/download/candidate-20240619.291/iree_compiler-20240619.291-cp311-cp311-win_amd64.whl https://github.com/nod-ai/SRT/releases/download/candidate-20240619.291/iree_runtime-20240619.291-cp311-cp311-win_amd64.whl
pip install -e .
Write-Host "Source your venv with ./shark.venv/Scripts/activate"