ChenyangSi commited on
Commit
a560a2b
1 Parent(s): 43a295c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +21 -20
app.py CHANGED
@@ -104,29 +104,30 @@ with block:
104
  container=False,
105
  )
106
  btn = gr.Button("Generate image", scale=0)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
107
 
108
  with gr.Accordion('FreeU Parameters', open=False):
109
- # sd_options = gr.Dropdown(options, label="SD options")
110
- sd_options = gr.Dropdown(options, value='SD1.4', label="SD options")
111
- # model_id = "CompVis/stable-diffusion-v1-4"
112
 
113
- if sd_options == 'SD1.4':
114
- model_id = "CompVis/stable-diffusion-v1-4"
115
- elif sd_options == 'SD1.5':
116
- model_id = "runwayml/stable-diffusion-v1-5"
117
- elif sd_options == 'SD2.1':
118
- model_id = "stabilityai/stable-diffusion-2-1"
119
-
120
- # pip_sd = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16)
121
- # pip_sd = pip_sd.to("cuda")
122
-
123
- # pip_freeu = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16)
124
- # pip_freeu = pip_freeu.to("cuda")
125
- # # -------- freeu block registration
126
- # register_free_upblock2d(pipe, b1=1.2, b2=1.4, s1=0.9, s2=0.2)
127
- # register_free_crossattn_upblock2d(pipe, b1=1.2, b2=1.4, s1=0.9, s2=0.2)
128
- # # -------- freeu block registration
129
-
130
  b1 = gr.Slider(label='b1: backbone factor of the first stage block of decoder',
131
  minimum=1,
132
  maximum=1.6,
 
104
  container=False,
105
  )
106
  btn = gr.Button("Generate image", scale=0)
107
+
108
+ # sd_options = gr.Dropdown(options, label="SD options")
109
+ sd_options = gr.Dropdown(options, value='SD1.4', label="SD options")
110
+ # model_id = "CompVis/stable-diffusion-v1-4"
111
+
112
+ if sd_options == 'SD1.4':
113
+ model_id = "CompVis/stable-diffusion-v1-4"
114
+ elif sd_options == 'SD1.5':
115
+ model_id = "runwayml/stable-diffusion-v1-5"
116
+ elif sd_options == 'SD2.1':
117
+ model_id = "stabilityai/stable-diffusion-2-1"
118
+
119
+ # pip_sd = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16)
120
+ # pip_sd = pip_sd.to("cuda")
121
+
122
+ # pip_freeu = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16)
123
+ # pip_freeu = pip_freeu.to("cuda")
124
+ # # -------- freeu block registration
125
+ # register_free_upblock2d(pipe, b1=1.2, b2=1.4, s1=0.9, s2=0.2)
126
+ # register_free_crossattn_upblock2d(pipe, b1=1.2, b2=1.4, s1=0.9, s2=0.2)
127
+ # # -------- freeu block registration
128
 
129
  with gr.Accordion('FreeU Parameters', open=False):
 
 
 
130
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
131
  b1 = gr.Slider(label='b1: backbone factor of the first stage block of decoder',
132
  minimum=1,
133
  maximum=1.6,