multimodalart HF staff commited on
Commit
c76773c
·
verified ·
1 Parent(s): 51a097e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -6,7 +6,7 @@ import gradio as gr
6
  import torch
7
  import spaces
8
 
9
- vae = AutoencoderKL.from_pretrained("stabilityai/sd-vae-ft-mse")
10
  #safety_checker=StableDiffusionSafetyChecker.from_pretrained("CompVis/stable-diffusion-safety-checker"),
11
  #feature_extractor=CLIPFeatureExtractor.from_pretrained("openai/clip-vit-base-patch32")
12
  pretrain_model = "SG161222/Realistic_Vision_V5.1_noVAE"
@@ -21,8 +21,8 @@ pipe = StableDiffusionPipeline.from_pretrained(pretrain_model, scheduler = sched
21
  apply_hidiffusion(pipe)
22
 
23
  @spaces.GPU
24
- def run_hidiffusion(prompt, negative_prompt):
25
- return pipe(prompt, guidance_scale=7.5, height=1024, width=1024, eta=1.0, negative_prompt=negative_prompt).images[0]
26
 
27
  with gr.Blocks() as demo:
28
  prompt = gr.Textbox()
 
6
  import torch
7
  import spaces
8
 
9
+ vae = AutoencoderKL.from_pretrained("stabilityai/sd-vae-ft-mse", torch_dtype=torch.float16)
10
  #safety_checker=StableDiffusionSafetyChecker.from_pretrained("CompVis/stable-diffusion-safety-checker"),
11
  #feature_extractor=CLIPFeatureExtractor.from_pretrained("openai/clip-vit-base-patch32")
12
  pretrain_model = "SG161222/Realistic_Vision_V5.1_noVAE"
 
21
  apply_hidiffusion(pipe)
22
 
23
  @spaces.GPU
24
+ def run_hidiffusion(prompt, negative_prompt, progress=gr.Progress(track_tqdm=True)):
25
+ return pipe(prompt, guidance_scale=7.5, height=1024, width=1024, eta=1.0, negative_prompt=negative_prompt, num_inference_steps=25).images[0]
26
 
27
  with gr.Blocks() as demo:
28
  prompt = gr.Textbox()