Spaces:
Runtime error
Runtime error
Disable Img2Img to avoid OOM
Browse files
app.py
CHANGED
@@ -362,6 +362,8 @@ class StableDiffusionInpaint:
|
|
362 |
process_height = height
|
363 |
if resize_check:
|
364 |
process_width, process_height = my_resize(width, height)
|
|
|
|
|
365 |
extra_kwargs = {
|
366 |
"num_inference_steps": step,
|
367 |
"guidance_scale": guidance_scale,
|
@@ -771,7 +773,7 @@ proceed_button_js = load_js("proceed")
|
|
771 |
setup_button_js = load_js("setup")
|
772 |
|
773 |
if RUN_IN_SPACE:
|
774 |
-
get_model(token=os.environ.get("hftoken", ""), model_choice=ModelChoice.
|
775 |
|
776 |
blocks = gr.Blocks(
|
777 |
title="StableDiffusion-Infinity",
|
|
|
362 |
process_height = height
|
363 |
if resize_check:
|
364 |
process_width, process_height = my_resize(width, height)
|
365 |
+
process_width=process_width*8//8
|
366 |
+
process_height=process_height*8//8
|
367 |
extra_kwargs = {
|
368 |
"num_inference_steps": step,
|
369 |
"guidance_scale": guidance_scale,
|
|
|
773 |
setup_button_js = load_js("setup")
|
774 |
|
775 |
if RUN_IN_SPACE:
|
776 |
+
get_model(token=os.environ.get("hftoken", ""), model_choice=ModelChoice.INPAINTING.value)
|
777 |
|
778 |
blocks = gr.Blocks(
|
779 |
title="StableDiffusion-Infinity",
|
canvas.py
CHANGED
@@ -332,12 +332,10 @@ class InfCanvas:
|
|
332 |
|
333 |
def refine_selection(self):
|
334 |
h,w=self.selection_size_h,self.selection_size_w
|
335 |
-
h=h//8*8
|
336 |
-
w=w//8*8
|
337 |
h=min(h,self.height)
|
338 |
w=min(w,self.width)
|
339 |
-
self.selection_size_h=h
|
340 |
-
self.selection_size_w=w
|
341 |
self.update_cursor(1,0)
|
342 |
|
343 |
|
|
|
332 |
|
333 |
def refine_selection(self):
|
334 |
h,w=self.selection_size_h,self.selection_size_w
|
|
|
|
|
335 |
h=min(h,self.height)
|
336 |
w=min(w,self.width)
|
337 |
+
self.selection_size_h=h*8//8
|
338 |
+
self.selection_size_w=w*8//8
|
339 |
self.update_cursor(1,0)
|
340 |
|
341 |
|