Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -16,8 +16,8 @@ import time
|
|
16 |
import os
|
17 |
from image_gen_aux import UpscaleWithModel
|
18 |
from huggingface_hub import hf_hub_download
|
19 |
-
from models.transformer_sd3 import SD3Transformer2DModel
|
20 |
-
from pipeline_stable_diffusion_3_ipa import StableDiffusion3Pipeline
|
21 |
from PIL import Image
|
22 |
|
23 |
FTP_HOST = "1ink.us"
|
@@ -63,12 +63,6 @@ checkpoint = "microsoft/Phi-3.5-mini-instruct"
|
|
63 |
vae = AutoencoderKL.from_pretrained("ford442/sdxl-vae-bf16")
|
64 |
#vae = AutoencoderKL.from_pretrained("ford442/sdxl-vae-bf16")
|
65 |
|
66 |
-
transformer = SD3Transformer2DModel.from_pretrained(
|
67 |
-
model_path,
|
68 |
-
subfolder="transformer",
|
69 |
-
torch_dtype=torch.bfloat16
|
70 |
-
)
|
71 |
-
|
72 |
pipe = StableDiffusion3Pipeline.from_pretrained("ford442/stable-diffusion-3.5-medium-bf16", transformer=transformer).to(device=torch.device("cuda:0"), dtype=torch.bfloat16)
|
73 |
#pipe = StableDiffusion3Pipeline.from_pretrained("ford442/stable-diffusion-3.5-medium-bf16").to(torch.device("cuda:0"))
|
74 |
#pipe = StableDiffusion3Pipeline.from_pretrained("ford442/RealVis_Medium_1.0b_bf16", torch_dtype=torch.bfloat16)
|
@@ -99,12 +93,6 @@ tokenizer.tokenizer_legacy=False
|
|
99 |
model = AutoModelForCausalLM.from_pretrained(checkpoint, device_map='balanced')
|
100 |
#model = torch.compile(model)
|
101 |
|
102 |
-
pipe.init_ipadapter(
|
103 |
-
ip_adapter_path=ipadapter_path,
|
104 |
-
image_encoder_path=image_encoder_path,
|
105 |
-
nb_token=64,
|
106 |
-
)
|
107 |
-
|
108 |
upscaler_2 = UpscaleWithModel.from_pretrained("Kim2091/ClearRealityV1").to(torch.device("cuda:0"))
|
109 |
|
110 |
def filter_text(text,phraseC):
|
|
|
16 |
import os
|
17 |
from image_gen_aux import UpscaleWithModel
|
18 |
from huggingface_hub import hf_hub_download
|
19 |
+
#from models.transformer_sd3 import SD3Transformer2DModel
|
20 |
+
#from pipeline_stable_diffusion_3_ipa import StableDiffusion3Pipeline
|
21 |
from PIL import Image
|
22 |
|
23 |
FTP_HOST = "1ink.us"
|
|
|
63 |
vae = AutoencoderKL.from_pretrained("ford442/sdxl-vae-bf16")
|
64 |
#vae = AutoencoderKL.from_pretrained("ford442/sdxl-vae-bf16")
|
65 |
|
|
|
|
|
|
|
|
|
|
|
|
|
66 |
pipe = StableDiffusion3Pipeline.from_pretrained("ford442/stable-diffusion-3.5-medium-bf16", transformer=transformer).to(device=torch.device("cuda:0"), dtype=torch.bfloat16)
|
67 |
#pipe = StableDiffusion3Pipeline.from_pretrained("ford442/stable-diffusion-3.5-medium-bf16").to(torch.device("cuda:0"))
|
68 |
#pipe = StableDiffusion3Pipeline.from_pretrained("ford442/RealVis_Medium_1.0b_bf16", torch_dtype=torch.bfloat16)
|
|
|
93 |
model = AutoModelForCausalLM.from_pretrained(checkpoint, device_map='balanced')
|
94 |
#model = torch.compile(model)
|
95 |
|
|
|
|
|
|
|
|
|
|
|
|
|
96 |
upscaler_2 = UpscaleWithModel.from_pretrained("Kim2091/ClearRealityV1").to(torch.device("cuda:0"))
|
97 |
|
98 |
def filter_text(text,phraseC):
|