hysts HF staff commited on
Commit
376f4dc
1 Parent(s): 2483fe6

Rename cond_tau to adapter_conditioning_factor

Browse files
Files changed (3) hide show
  1. app_base.py +7 -6
  2. app_sketch.py +7 -6
  3. model.py +2 -2
app_base.py CHANGED
@@ -28,7 +28,7 @@ def create_demo(model: Model) -> gr.Blocks:
28
  num_inference_steps: int = 30,
29
  guidance_scale: float = 5.0,
30
  adapter_conditioning_scale: float = 1.0,
31
- cond_tau: float = 1.0,
32
  seed: int = 0,
33
  apply_preprocess: bool = True,
34
  progress=gr.Progress(track_tqdm=True),
@@ -43,7 +43,7 @@ def create_demo(model: Model) -> gr.Blocks:
43
  num_inference_steps=num_inference_steps,
44
  guidance_scale=guidance_scale,
45
  adapter_conditioning_scale=adapter_conditioning_scale,
46
- cond_tau=cond_tau,
47
  seed=seed,
48
  apply_preprocess=apply_preprocess,
49
  )
@@ -130,14 +130,15 @@ def create_demo(model: Model) -> gr.Blocks:
130
  value=5.0,
131
  )
132
  adapter_conditioning_scale = gr.Slider(
133
- label="Adapter Conditioning Scale",
134
  minimum=0.5,
135
  maximum=1,
136
  step=0.1,
137
  value=1.0,
138
  )
139
- cond_tau = gr.Slider(
140
- label="Fraction of timesteps for which adapter should be applied",
 
141
  minimum=0.5,
142
  maximum=1.0,
143
  step=0.1,
@@ -177,7 +178,7 @@ def create_demo(model: Model) -> gr.Blocks:
177
  num_inference_steps,
178
  guidance_scale,
179
  adapter_conditioning_scale,
180
- cond_tau,
181
  seed,
182
  apply_preprocess,
183
  ]
 
28
  num_inference_steps: int = 30,
29
  guidance_scale: float = 5.0,
30
  adapter_conditioning_scale: float = 1.0,
31
+ adapter_conditioning_factor: float = 1.0,
32
  seed: int = 0,
33
  apply_preprocess: bool = True,
34
  progress=gr.Progress(track_tqdm=True),
 
43
  num_inference_steps=num_inference_steps,
44
  guidance_scale=guidance_scale,
45
  adapter_conditioning_scale=adapter_conditioning_scale,
46
+ adapter_conditioning_factor=adapter_conditioning_factor,
47
  seed=seed,
48
  apply_preprocess=apply_preprocess,
49
  )
 
130
  value=5.0,
131
  )
132
  adapter_conditioning_scale = gr.Slider(
133
+ label="Adapter conditioning scale",
134
  minimum=0.5,
135
  maximum=1,
136
  step=0.1,
137
  value=1.0,
138
  )
139
+ adapter_conditioning_factor = gr.Slider(
140
+ label="Adapter conditioning factor",
141
+ info="Fraction of timesteps for which adapter should be applied",
142
  minimum=0.5,
143
  maximum=1.0,
144
  step=0.1,
 
178
  num_inference_steps,
179
  guidance_scale,
180
  adapter_conditioning_scale,
181
+ adapter_conditioning_factor,
182
  seed,
183
  apply_preprocess,
184
  ]
app_sketch.py CHANGED
@@ -26,7 +26,7 @@ def create_demo(model: Model) -> gr.Blocks:
26
  num_steps: int = 25,
27
  guidance_scale: float = 5,
28
  adapter_conditioning_scale: float = 0.8,
29
- cond_tau: float = 0.8,
30
  seed: int = 0,
31
  progress=gr.Progress(track_tqdm=True),
32
  ) -> PIL.Image.Image:
@@ -44,7 +44,7 @@ def create_demo(model: Model) -> gr.Blocks:
44
  num_inference_steps=num_steps,
45
  guidance_scale=guidance_scale,
46
  adapter_conditioning_scale=adapter_conditioning_scale,
47
- cond_tau=cond_tau,
48
  seed=seed,
49
  apply_preprocess=False,
50
  )[1]
@@ -83,14 +83,15 @@ def create_demo(model: Model) -> gr.Blocks:
83
  value=5,
84
  )
85
  adapter_conditioning_scale = gr.Slider(
86
- label="Adapter Conditioning Scale",
87
  minimum=0.5,
88
  maximum=1,
89
  step=0.1,
90
  value=0.8,
91
  )
92
- cond_tau = gr.Slider(
93
- label="Fraction of timesteps for which adapter should be applied",
 
94
  minimum=0.5,
95
  maximum=1,
96
  step=0.1,
@@ -115,7 +116,7 @@ def create_demo(model: Model) -> gr.Blocks:
115
  num_steps,
116
  guidance_scale,
117
  adapter_conditioning_scale,
118
- cond_tau,
119
  seed,
120
  ]
121
  prompt.submit(
 
26
  num_steps: int = 25,
27
  guidance_scale: float = 5,
28
  adapter_conditioning_scale: float = 0.8,
29
+ adapter_conditioning_factor: float = 0.8,
30
  seed: int = 0,
31
  progress=gr.Progress(track_tqdm=True),
32
  ) -> PIL.Image.Image:
 
44
  num_inference_steps=num_steps,
45
  guidance_scale=guidance_scale,
46
  adapter_conditioning_scale=adapter_conditioning_scale,
47
+ adapter_conditioning_factor=adapter_conditioning_factor,
48
  seed=seed,
49
  apply_preprocess=False,
50
  )[1]
 
83
  value=5,
84
  )
85
  adapter_conditioning_scale = gr.Slider(
86
+ label="Adapter conditioning scale",
87
  minimum=0.5,
88
  maximum=1,
89
  step=0.1,
90
  value=0.8,
91
  )
92
+ adapter_conditioning_factor = gr.Slider(
93
+ label="Adapter conditioning factor",
94
+ info="Fraction of timesteps for which adapter should be applied",
95
  minimum=0.5,
96
  maximum=1,
97
  step=0.1,
 
116
  num_steps,
117
  guidance_scale,
118
  adapter_conditioning_scale,
119
+ adapter_conditioning_factor,
120
  seed,
121
  ]
122
  prompt.submit(
model.py CHANGED
@@ -317,7 +317,7 @@ class Model:
317
  num_inference_steps: int = 30,
318
  guidance_scale: float = 5.0,
319
  adapter_conditioning_scale: float = 1.0,
320
- cond_tau: float = 1.0,
321
  seed: int = 0,
322
  apply_preprocess: bool = True,
323
  ) -> list[PIL.Image.Image]:
@@ -344,7 +344,7 @@ class Model:
344
  image=image,
345
  num_inference_steps=num_inference_steps,
346
  adapter_conditioning_scale=adapter_conditioning_scale,
347
- adapter_conditioning_factor=cond_tau,
348
  generator=generator,
349
  guidance_scale=guidance_scale,
350
  ).images[0]
 
317
  num_inference_steps: int = 30,
318
  guidance_scale: float = 5.0,
319
  adapter_conditioning_scale: float = 1.0,
320
+ adapter_conditioning_factor: float = 1.0,
321
  seed: int = 0,
322
  apply_preprocess: bool = True,
323
  ) -> list[PIL.Image.Image]:
 
344
  image=image,
345
  num_inference_steps=num_inference_steps,
346
  adapter_conditioning_scale=adapter_conditioning_scale,
347
+ adapter_conditioning_factor=adapter_conditioning_factor,
348
  generator=generator,
349
  guidance_scale=guidance_scale,
350
  ).images[0]