Spaces:
Running
Running
patrickvonplaten
commited on
Commit
•
7f458a0
1
Parent(s):
9ce2bc6
upload
Browse files- LCM_Dreamshaper_v7_4k.safetensors +3 -0
- __pycache__/app.cpython-310.pyc +0 -0
- app.py +5 -1
LCM_Dreamshaper_v7_4k.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:84feab3a32f1d36108b762b25dad483ca9e37f719b23e0cfd0fdc4ad3fd5409b
|
3 |
+
size 3438495296
|
__pycache__/app.cpython-310.pyc
CHANGED
Binary files a/__pycache__/app.cpython-310.pyc and b/__pycache__/app.cpython-310.pyc differ
|
|
app.py
CHANGED
@@ -33,6 +33,7 @@ DTYPE = torch.float32 # torch.float16 works as well, but pictures seem to be a
|
|
33 |
|
34 |
model_id = "digiplay/DreamShaper_7"
|
35 |
|
|
|
36 |
# Initalize Diffusers Model:
|
37 |
vae = AutoencoderKL.from_pretrained(model_id, subfolder="vae")
|
38 |
text_encoder = CLIPTextModel.from_pretrained(model_id, subfolder="text_encoder")
|
@@ -47,9 +48,12 @@ feature_extractor = CLIPImageProcessor.from_pretrained(model_id, subfolder="feat
|
|
47 |
# Initalize Scheduler:
|
48 |
scheduler = LCMScheduler(beta_start=0.00085, beta_end=0.0120, beta_schedule="scaled_linear", prediction_type="epsilon")
|
49 |
|
|
|
|
|
50 |
if torch.cuda.is_available():
|
51 |
# Replace the unet with LCM:
|
52 |
-
lcm_unet_ckpt = hf_hub_download("SimianLuo/LCM_Dreamshaper_v7", filename="LCM_Dreamshaper_v7_4k.safetensors")
|
|
|
53 |
ckpt = load_file(lcm_unet_ckpt)
|
54 |
m, u = unet.load_state_dict(ckpt, strict=False)
|
55 |
if len(m) > 0:
|
|
|
33 |
|
34 |
model_id = "digiplay/DreamShaper_7"
|
35 |
|
36 |
+
|
37 |
# Initalize Diffusers Model:
|
38 |
vae = AutoencoderKL.from_pretrained(model_id, subfolder="vae")
|
39 |
text_encoder = CLIPTextModel.from_pretrained(model_id, subfolder="text_encoder")
|
|
|
48 |
# Initalize Scheduler:
|
49 |
scheduler = LCMScheduler(beta_start=0.00085, beta_end=0.0120, beta_schedule="scaled_linear", prediction_type="epsilon")
|
50 |
|
51 |
+
HF_TOKEN = os.environ.get("HF_TOKEN", None)
|
52 |
+
|
53 |
if torch.cuda.is_available():
|
54 |
# Replace the unet with LCM:
|
55 |
+
# lcm_unet_ckpt = hf_hub_download("SimianLuo/LCM_Dreamshaper_v7", filename="LCM_Dreamshaper_v7_4k.safetensors", token=HF_TOKEN)
|
56 |
+
lcm_unet_ckpt = "./LCM_Dreamshaper_v7_4k.safetensors"
|
57 |
ckpt = load_file(lcm_unet_ckpt)
|
58 |
m, u = unet.load_state_dict(ckpt, strict=False)
|
59 |
if len(m) > 0:
|