Update app.py
Browse files
app.py
CHANGED
|
@@ -81,15 +81,15 @@ pipe = StableDiffusion3Pipeline.from_pretrained(
|
|
| 81 |
#torch_dtype=torch.bfloat16,
|
| 82 |
#use_safetensors=False,
|
| 83 |
)
|
| 84 |
-
text_encoder=CLIPTextModelWithProjection.from_pretrained("ford442/stable-diffusion-3.5-large-bf16", subfolder='text_encoder', token=True).to(device)
|
| 85 |
-
text_encoder_2=CLIPTextModelWithProjection.from_pretrained("ford442/stable-diffusion-3.5-large-bf16", subfolder='text_encoder_2',token=True).to(device)
|
| 86 |
-
text_encoder_3=T5EncoderModel.from_pretrained("ford442/stable-diffusion-3.5-large-bf16", subfolder='text_encoder_3',token=True).to(device)
|
| 87 |
|
| 88 |
pipe.load_lora_weights("ford442/sdxl-vae-bf16", weight_name="LoRA/UltraReal.safetensors")
|
| 89 |
|
| 90 |
pipe.to(device=device, dtype=torch.bfloat16)
|
| 91 |
#pipe.to(device)
|
| 92 |
-
pipe.vae=vaeX
|
| 93 |
upscaler_2 = UpscaleWithModel.from_pretrained("Kim2091/ClearRealityV1").to(torch.device('cpu'))
|
| 94 |
|
| 95 |
MAX_SEED = np.iinfo(np.int32).max
|
|
@@ -115,7 +115,6 @@ def infer_30(
|
|
| 115 |
seed = random.randint(0, MAX_SEED)
|
| 116 |
generator = torch.Generator(device='cuda').manual_seed(seed)
|
| 117 |
print('-- generating image --')
|
| 118 |
-
|
| 119 |
sd_image = pipe(
|
| 120 |
prompt=prompt,
|
| 121 |
prompt_2=prompt,
|
|
|
|
| 81 |
#torch_dtype=torch.bfloat16,
|
| 82 |
#use_safetensors=False,
|
| 83 |
)
|
| 84 |
+
text_encoder=CLIPTextModelWithProjection.from_pretrained("ford442/stable-diffusion-3.5-large-bf16", subfolder='text_encoder', torch_dtype=torch.bfloat16, token=True).to(device)
|
| 85 |
+
text_encoder_2=CLIPTextModelWithProjection.from_pretrained("ford442/stable-diffusion-3.5-large-bf16", subfolder='text_encoder_2', torch_dtype=torch.bfloat16,token=True).to(device)
|
| 86 |
+
text_encoder_3=T5EncoderModel.from_pretrained("ford442/stable-diffusion-3.5-large-bf16", subfolder='text_encoder_3', torch_dtype=torch.bfloat16,token=True).to(device)
|
| 87 |
|
| 88 |
pipe.load_lora_weights("ford442/sdxl-vae-bf16", weight_name="LoRA/UltraReal.safetensors")
|
| 89 |
|
| 90 |
pipe.to(device=device, dtype=torch.bfloat16)
|
| 91 |
#pipe.to(device)
|
| 92 |
+
pipe.vae=vaeX #.to('cpu')
|
| 93 |
upscaler_2 = UpscaleWithModel.from_pretrained("Kim2091/ClearRealityV1").to(torch.device('cpu'))
|
| 94 |
|
| 95 |
MAX_SEED = np.iinfo(np.int32).max
|
|
|
|
| 115 |
seed = random.randint(0, MAX_SEED)
|
| 116 |
generator = torch.Generator(device='cuda').manual_seed(seed)
|
| 117 |
print('-- generating image --')
|
|
|
|
| 118 |
sd_image = pipe(
|
| 119 |
prompt=prompt,
|
| 120 |
prompt_2=prompt,
|