ford442 commited on
Commit
d707e05
·
verified ·
1 Parent(s): 24bca70

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -4,7 +4,7 @@ import numpy as np
4
  import random
5
 
6
  import torch
7
- from diffusers import StableDiffusion3Pipeline
8
  #from transformers import CLIPTextModelWithProjection, T5EncoderModel
9
  from transformers import CLIPTokenizer, T5TokenizerFast
10
 
@@ -61,6 +61,7 @@ def upload_to_ftp(filename):
61
  pyx = cyper.inline(code, fast_indexing=True, directives=dict(boundscheck=False, wraparound=False, language_level=3))
62
 
63
  device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
 
64
 
65
  pipe = StableDiffusion3Pipeline.from_pretrained(
66
  #"stabilityai # stable-diffusion-3.5-large",
@@ -73,6 +74,7 @@ pipe = StableDiffusion3Pipeline.from_pretrained(
73
  #tokenizer=CLIPTokenizer.from_pretrained("ford442/stable-diffusion-3.5-large-bf16", add_prefix_space=True, subfolder="tokenizer", token=True),
74
  #tokenizer_2=CLIPTokenizer.from_pretrained("ford442/stable-diffusion-3.5-large-bf16", add_prefix_space=True, subfolder="tokenizer_2", token=True),
75
  tokenizer_3=T5TokenizerFast.from_pretrained("ford442/stable-diffusion-3.5-large-bf16", add_prefix_space=False, use_fast=True, subfolder="tokenizer_3", token=True),
 
76
  #torch_dtype=torch.bfloat16,
77
  #use_safetensors=False,
78
  )
 
4
  import random
5
 
6
  import torch
7
+ from diffusers import StableDiffusion3Pipeline, AutoencoderKL
8
  #from transformers import CLIPTextModelWithProjection, T5EncoderModel
9
  from transformers import CLIPTokenizer, T5TokenizerFast
10
 
 
61
  pyx = cyper.inline(code, fast_indexing=True, directives=dict(boundscheck=False, wraparound=False, language_level=3))
62
 
63
  device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
64
+ vaeX=AutoencoderKL.from_pretrained("ford442/sdxl-vae-bf16", use_safetensors=True, subfolder='sd3-vae',token=True)
65
 
66
  pipe = StableDiffusion3Pipeline.from_pretrained(
67
  #"stabilityai # stable-diffusion-3.5-large",
 
74
  #tokenizer=CLIPTokenizer.from_pretrained("ford442/stable-diffusion-3.5-large-bf16", add_prefix_space=True, subfolder="tokenizer", token=True),
75
  #tokenizer_2=CLIPTokenizer.from_pretrained("ford442/stable-diffusion-3.5-large-bf16", add_prefix_space=True, subfolder="tokenizer_2", token=True),
76
  tokenizer_3=T5TokenizerFast.from_pretrained("ford442/stable-diffusion-3.5-large-bf16", add_prefix_space=False, use_fast=True, subfolder="tokenizer_3", token=True),
77
+ vae=vaeX,
78
  #torch_dtype=torch.bfloat16,
79
  #use_safetensors=False,
80
  )