Spaces:
Runtime error
Runtime error
fix skip_timesteps
Browse files
app.py
CHANGED
@@ -82,6 +82,7 @@ def range_loss(input):
|
|
82 |
|
83 |
def inference(text, init_image, skip_timesteps, clip_guidance_scale, tv_scale, range_scale, init_scale, seed, image_prompts,timestep_respacing, cutn, im_prompt_weight):
|
84 |
# Model settings
|
|
|
85 |
device = torch.device('cuda:0' if torch.cuda.is_available() else 'cpu')
|
86 |
model_config = model_and_diffusion_defaults()
|
87 |
model_config.update({
|
@@ -245,8 +246,8 @@ with demo:
|
|
245 |
# with gr.Group():
|
246 |
with gr.Column():
|
247 |
init_image = gr.Image(source="upload", label='initial image (optional)')
|
248 |
-
init_scale = gr.Slider(minimum=0, maximum=
|
249 |
-
skip_timesteps = gr.Slider(minimum=0, maximum=
|
250 |
# with gr.Group():
|
251 |
with gr.Column():
|
252 |
image_prompts = gr.Image(source="upload", label='image prompt (optional)')
|
|
|
82 |
|
83 |
def inference(text, init_image, skip_timesteps, clip_guidance_scale, tv_scale, range_scale, init_scale, seed, image_prompts,timestep_respacing, cutn, im_prompt_weight):
|
84 |
# Model settings
|
85 |
+
skip_timesteps = min(skip_timesteps, timestep_respacing-1)
|
86 |
device = torch.device('cuda:0' if torch.cuda.is_available() else 'cpu')
|
87 |
model_config = model_and_diffusion_defaults()
|
88 |
model_config.update({
|
|
|
246 |
# with gr.Group():
|
247 |
with gr.Column():
|
248 |
init_image = gr.Image(source="upload", label='initial image (optional)')
|
249 |
+
init_scale = gr.Slider(minimum=0, maximum=1000, step=100, value=10000, label="Look like the image above")
|
250 |
+
skip_timesteps = gr.Slider(minimum=0, maximum=100, step=1, value=0, label="Style strength")
|
251 |
# with gr.Group():
|
252 |
with gr.Column():
|
253 |
image_prompts = gr.Image(source="upload", label='image prompt (optional)')
|