Update app.py
Browse files
app.py
CHANGED
|
@@ -45,10 +45,6 @@ from PIL import Image
|
|
| 45 |
from image_gen_aux import UpscaleWithModel
|
| 46 |
|
| 47 |
|
| 48 |
-
from diffusers.models.attention_processor import AttnProcessor2_0
|
| 49 |
-
from diffusers.models.attention_processor import Attention
|
| 50 |
-
|
| 51 |
-
|
| 52 |
# --- GCS Configuration ---
|
| 53 |
# Make sure to set these secrets in your Hugging Face Space settings
|
| 54 |
GCS_BUCKET_NAME = os.getenv("GCS_BUCKET_NAME")
|
|
@@ -105,13 +101,8 @@ def load_model():
|
|
| 105 |
pipe.transformer=ll_transformer
|
| 106 |
pipe.load_lora_weights("ford442/sdxl-vae-bf16", weight_name="LoRA/UltraReal.safetensors")
|
| 107 |
pipe.to(device=device, dtype=torch.bfloat16)
|
| 108 |
-
#for name, module in pipe.transformer.named_modules():
|
| 109 |
-
# if isinstance(module, Attention):
|
| 110 |
-
# module.processor = fa_processor
|
| 111 |
upscaler_2 = UpscaleWithModel.from_pretrained("Kim2091/ClearRealityV1").to(device)
|
| 112 |
return pipe, upscaler_2
|
| 113 |
-
|
| 114 |
-
fa_processor = FlashAttentionProcessor()
|
| 115 |
|
| 116 |
pipe, upscaler_2 = load_model()
|
| 117 |
|
|
|
|
| 45 |
from image_gen_aux import UpscaleWithModel
|
| 46 |
|
| 47 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 48 |
# --- GCS Configuration ---
|
| 49 |
# Make sure to set these secrets in your Hugging Face Space settings
|
| 50 |
GCS_BUCKET_NAME = os.getenv("GCS_BUCKET_NAME")
|
|
|
|
| 101 |
pipe.transformer=ll_transformer
|
| 102 |
pipe.load_lora_weights("ford442/sdxl-vae-bf16", weight_name="LoRA/UltraReal.safetensors")
|
| 103 |
pipe.to(device=device, dtype=torch.bfloat16)
|
|
|
|
|
|
|
|
|
|
| 104 |
upscaler_2 = UpscaleWithModel.from_pretrained("Kim2091/ClearRealityV1").to(device)
|
| 105 |
return pipe, upscaler_2
|
|
|
|
|
|
|
| 106 |
|
| 107 |
pipe, upscaler_2 = load_model()
|
| 108 |
|