mirror of
https://github.com/nod-ai/SHARK-Studio.git
synced 2026-01-09 22:07:55 -05:00
[SD] Add fix for using latest diffusers + add scribble variant to Stencil (#1191)
* [SD] Add Scribble variant in Stencil -- This commit adds scribble variant in Stencil. Signed-off-by: Abhishek Varma <abhishek@nod-labs.com> * [SD] Use latest diffusers -- This commit points back to the latest diffusers and updates the processing script to tackle the Pix2Pix import issue. Signed-off-by: Abhishek Varma <abhishek@nod-labs.com> --------- Signed-off-by: Abhishek Varma <abhishek@nod-labs.com> Co-authored-by: Abhishek Varma <abhishek@nod-labs.com>
This commit is contained in:
@@ -7,14 +7,35 @@ import fileinput
|
||||
from pathlib import Path
|
||||
|
||||
# Diffusers 0.13.1 fails with transformers __init.py errros in BLIP. So remove it for now until we fork it
|
||||
pix2pix_file = Path(
|
||||
get_python_lib()
|
||||
+ "/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_pix2pix_zero.py"
|
||||
pix2pix_init = Path(get_python_lib() + "/diffusers/__init__.py")
|
||||
for line in fileinput.input(pix2pix_init, inplace=True):
|
||||
if "Pix2Pix" in line:
|
||||
if not line.startswith("#"):
|
||||
print(f"#{line}", end="")
|
||||
else:
|
||||
print(f"{line[1:]}", end="")
|
||||
else:
|
||||
print(line, end="")
|
||||
pix2pix_init = Path(get_python_lib() + "/diffusers/pipelines/__init__.py")
|
||||
for line in fileinput.input(pix2pix_init, inplace=True):
|
||||
if "Pix2Pix" in line:
|
||||
if not line.startswith("#"):
|
||||
print(f"#{line}", end="")
|
||||
else:
|
||||
print(f"{line[1:]}", end="")
|
||||
else:
|
||||
print(line, end="")
|
||||
pix2pix_init = Path(
|
||||
get_python_lib() + "/diffusers/pipelines/stable_diffusion/__init__.py"
|
||||
)
|
||||
if pix2pix_file.exists():
|
||||
print("Removing..%s", pix2pix_file)
|
||||
pix2pix_file.unlink()
|
||||
|
||||
for line in fileinput.input(pix2pix_init, inplace=True):
|
||||
if "StableDiffusionPix2PixZeroPipeline" in line:
|
||||
if not line.startswith("#"):
|
||||
print(f"#{line}", end="")
|
||||
else:
|
||||
print(f"{line[1:]}", end="")
|
||||
else:
|
||||
print(line, end="")
|
||||
|
||||
path_to_skipfiles = Path(get_python_lib() + "/torch/_dynamo/skipfiles.py")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user