michaelriedl commited on
Commit
b0a0e6f
1 Parent(s): 8bd791b

Updated app

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -5,7 +5,7 @@ import numpy as np
5
  from PIL import Image
6
  from diffusers import StableDiffusionPipeline, DPMSolverMultistepScheduler
7
 
8
- MAX_IMAGES = 4
9
 
10
 
11
  def generate_images(
@@ -40,7 +40,7 @@ def generate_images(
40
  prompt,
41
  height=288,
42
  width=288,
43
- num_inference_steps=25,
44
  guidance_scale=7.5,
45
  cross_attention_kwargs={"scale": 1.0},
46
  ).images[0]
@@ -58,7 +58,7 @@ lora_model_path = "michaelriedl/MonsterForgeFusion-sd-2-base"
58
 
59
  # Create the pipeline
60
  pipe = StableDiffusionPipeline.from_pretrained(
61
- model_base, torch_dtype=torch.float16, use_safetensors=False, local_files_only=False
62
  )
63
  pipe.scheduler = DPMSolverMultistepScheduler.from_config(pipe.scheduler.config)
64
  pipe.unet.load_attn_procs(lora_model_path)
@@ -77,7 +77,7 @@ with demo:
77
  with gr.Column():
78
  with gr.Row():
79
  gallery = gr.Gallery(
80
- columns=4,
81
  object_fit="scale-down",
82
  )
83
  with gr.Row():
 
5
  from PIL import Image
6
  from diffusers import StableDiffusionPipeline, DPMSolverMultistepScheduler
7
 
8
+ MAX_IMAGES = 1
9
 
10
 
11
  def generate_images(
 
40
  prompt,
41
  height=288,
42
  width=288,
43
+ num_inference_steps=10,
44
  guidance_scale=7.5,
45
  cross_attention_kwargs={"scale": 1.0},
46
  ).images[0]
 
58
 
59
  # Create the pipeline
60
  pipe = StableDiffusionPipeline.from_pretrained(
61
+ model_base, torch_dtype=torch.float32, use_safetensors=False, local_files_only=False
62
  )
63
  pipe.scheduler = DPMSolverMultistepScheduler.from_config(pipe.scheduler.config)
64
  pipe.unet.load_attn_procs(lora_model_path)
 
77
  with gr.Column():
78
  with gr.Row():
79
  gallery = gr.Gallery(
80
+ columns=MAX_IMAGES,
81
  object_fit="scale-down",
82
  )
83
  with gr.Row():