owiedotch commited on
Commit
21dfb87
·
verified ·
1 Parent(s): a5460dd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -10
app.py CHANGED
@@ -122,18 +122,12 @@ def process(
122
  for _ in tqdm(range(num_samples)):
123
  shape = (1, 4, height // 8, width // 8)
124
  x_T = torch.randn(shape, device=device, dtype=torch.float32)
125
- # Create unconditional embeddings for classifier-free guidance
126
- c = model.get_learned_conditioning([positive_prompt])
127
- uc = model.get_learned_conditioning([negative_prompt])
128
-
129
  if not tile_diffusion:
130
  samples = sampler.sample_ccsr(
131
  steps=steps, t_max=0.6667, t_min=0.3333, shape=shape, cond_img=control,
132
  positive_prompt=positive_prompt, negative_prompt=negative_prompt, x_T=x_T,
133
  cfg_scale=cfg_scale,
134
- color_fix_type="adain" if use_color_fix else "none",
135
- # Pass unconditional embeddings to the sampler
136
- unconditional_conditioning=uc,
137
  )
138
  else:
139
  samples = sampler.sample_with_tile_ccsr(
@@ -141,9 +135,7 @@ def process(
141
  steps=steps, t_max=0.6667, t_min=0.3333, shape=shape, cond_img=control,
142
  positive_prompt=positive_prompt, negative_prompt=negative_prompt, x_T=x_T,
143
  cfg_scale=cfg_scale,
144
- color_fix_type="adain" if use_color_fix else "none",
145
- # Pass unconditional embeddings to the sampler
146
- unconditional_conditioning=uc,
147
  )
148
 
149
  x_samples = samples.clamp(0, 1)
 
122
  for _ in tqdm(range(num_samples)):
123
  shape = (1, 4, height // 8, width // 8)
124
  x_T = torch.randn(shape, device=device, dtype=torch.float32)
 
 
 
 
125
  if not tile_diffusion:
126
  samples = sampler.sample_ccsr(
127
  steps=steps, t_max=0.6667, t_min=0.3333, shape=shape, cond_img=control,
128
  positive_prompt=positive_prompt, negative_prompt=negative_prompt, x_T=x_T,
129
  cfg_scale=cfg_scale,
130
+ color_fix_type="adain" if use_color_fix else "none"
 
 
131
  )
132
  else:
133
  samples = sampler.sample_with_tile_ccsr(
 
135
  steps=steps, t_max=0.6667, t_min=0.3333, shape=shape, cond_img=control,
136
  positive_prompt=positive_prompt, negative_prompt=negative_prompt, x_T=x_T,
137
  cfg_scale=cfg_scale,
138
+ color_fix_type="adain" if use_color_fix else "none"
 
 
139
  )
140
 
141
  x_samples = samples.clamp(0, 1)