ford442 commited on
Commit
8e8b8e3
·
verified ·
1 Parent(s): 920d47b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -164,18 +164,20 @@ def load_and_prepare_model():
164
 
165
  #pipe.unet.to(memory_format=torch.channels_last)
166
  #pipe.enable_vae_tiling()
167
- pipe.unet = torch.compile(pipe.unet, backend="hidet")
168
  pipe.to(device=device, dtype=torch.bfloat16)
169
 
170
  return pipe
171
 
172
  hidet.option.parallel_build(True)
173
- #hidet.option.parallel_tune(-1,2.0)
174
 
175
  torch._dynamo.config.suppress_errors = True
176
  torch._dynamo.disallow_in_graph(diffusers.models.attention.BasicTransformerBlock)
177
  # Preload and compile both models
178
 
 
 
179
 
180
  # more search
181
  hidet.torch.dynamo_config.search_space(0)
@@ -189,8 +191,7 @@ hidet.option.cache_dir("local_cache")
189
  hidet.torch.dynamo_config.use_tensor_core()
190
  #hidet.torch.dynamo_config.steal_weights(False)
191
 
192
- pipe = load_and_prepare_model()
193
-
194
  MAX_SEED = np.iinfo(np.int32).max
195
 
196
  neg_prompt_2 = " 'non-photorealistic':1.5, 'unrealistic skin','unattractive face':1.3, 'low quality':1.1, ('dull color scheme', 'dull colors', 'digital noise':1.2),'amateurish', 'poorly drawn face':1.3, 'poorly drawn', 'distorted face', 'low resolution', 'simplistic' "
 
164
 
165
  #pipe.unet.to(memory_format=torch.channels_last)
166
  #pipe.enable_vae_tiling()
167
+ #pipe.unet = torch.compile(pipe.unet, backend="hidet")
168
  pipe.to(device=device, dtype=torch.bfloat16)
169
 
170
  return pipe
171
 
172
  hidet.option.parallel_build(True)
173
+ hidet.option.parallel_tune(-1,4.0)
174
 
175
  torch._dynamo.config.suppress_errors = True
176
  torch._dynamo.disallow_in_graph(diffusers.models.attention.BasicTransformerBlock)
177
  # Preload and compile both models
178
 
179
+ pipe = load_and_prepare_model()
180
+
181
 
182
  # more search
183
  hidet.torch.dynamo_config.search_space(0)
 
191
  hidet.torch.dynamo_config.use_tensor_core()
192
  #hidet.torch.dynamo_config.steal_weights(False)
193
 
194
+ pipe.unet = torch.compile(pipe.unet, backend="hidet")
 
195
  MAX_SEED = np.iinfo(np.int32).max
196
 
197
  neg_prompt_2 = " 'non-photorealistic':1.5, 'unrealistic skin','unattractive face':1.3, 'low quality':1.1, ('dull color scheme', 'dull colors', 'digital noise':1.2),'amateurish', 'poorly drawn face':1.3, 'poorly drawn', 'distorted face', 'low resolution', 'simplistic' "