Spaces:
Running on Zero
Running on Zero
[Admin maintenance] Support new ZeroGPU hardware
#4
by multimodalart HF Staff - opened
- app.py +1 -1
- requirements.txt +1 -3
app.py
CHANGED
|
@@ -41,7 +41,7 @@ if not path.exists(cache_path):
|
|
| 41 |
|
| 42 |
pipe = StableDiffusionXLPipeline.from_pretrained("stabilityai/stable-diffusion-xl-base-1.0", torch_dtype=torch.bfloat16)
|
| 43 |
pipe.to(device="cuda", dtype=torch.bfloat16)
|
| 44 |
-
unet_state = load_file(hf_hub_download("ByteDance/Hyper-SD", "Hyper-SDXL-1step-Unet.safetensors")
|
| 45 |
pipe.unet.load_state_dict(unet_state)
|
| 46 |
pipe.scheduler = LCMScheduler.from_config(pipe.scheduler.config, timestep_spacing ="trailing")
|
| 47 |
|
|
|
|
| 41 |
|
| 42 |
pipe = StableDiffusionXLPipeline.from_pretrained("stabilityai/stable-diffusion-xl-base-1.0", torch_dtype=torch.bfloat16)
|
| 43 |
pipe.to(device="cuda", dtype=torch.bfloat16)
|
| 44 |
+
unet_state = load_file(hf_hub_download("ByteDance/Hyper-SD", "Hyper-SDXL-1step-Unet.safetensors")) # ZeroGPU: load on CPU; load_state_dict copies into the already-cuda unet params
|
| 45 |
pipe.unet.load_state_dict(unet_state)
|
| 46 |
pipe.scheduler = LCMScheduler.from_config(pipe.scheduler.config, timestep_spacing ="trailing")
|
| 47 |
|
requirements.txt
CHANGED
|
@@ -1,10 +1,8 @@
|
|
| 1 |
diffusers==0.25.0
|
| 2 |
transformers==4.38.2
|
| 3 |
accelerate==0.27.2
|
| 4 |
-
gradio==3.41.2
|
| 5 |
-
httpx==0.23.0
|
| 6 |
flask
|
| 7 |
pillow
|
| 8 |
safetensors
|
| 9 |
transformers
|
| 10 |
-
torch
|
|
|
|
| 1 |
diffusers==0.25.0
|
| 2 |
transformers==4.38.2
|
| 3 |
accelerate==0.27.2
|
|
|
|
|
|
|
| 4 |
flask
|
| 5 |
pillow
|
| 6 |
safetensors
|
| 7 |
transformers
|
| 8 |
+
torch
|