Spaces:
				
			
			
	
			
			
		Running
		
			on 
			
			Zero
	
	
	
			
			
	
	
	
	
		
		
		Running
		
			on 
			
			Zero
	Minor fix for ZeroGPU (#2)
Browse files- Minor fix for ZeroGPU (0d7fcf25493b0185377089633ff9ff397b3ea69b)
Co-authored-by: hysts <[email protected]>
    	
        app.py
    CHANGED
    
    | 
         @@ -56,6 +56,7 @@ pipe = load_evo_nishikie(device) 
     | 
|
| 56 | 
         
             
            pipe.scheduler = EulerDiscreteScheduler.from_config(
         
     | 
| 57 | 
         
             
                pipe.scheduler.config, use_karras_sigmas=True,
         
     | 
| 58 | 
         
             
            )
         
     | 
| 
         | 
|
| 59 | 
         
             
            # pipe.unet.to(memory_format=torch.channels_last)
         
     | 
| 60 | 
         
             
            # pipe.controlnet.to(memory_format=torch.channels_last)
         
     | 
| 61 | 
         
             
            # pipe.vae.to(memory_format=torch.channels_last)
         
     | 
| 
         @@ -84,8 +85,6 @@ def generate( 
     | 
|
| 84 | 
         
             
                randomize_seed: bool = False,
         
     | 
| 85 | 
         
             
                progress=gr.Progress(track_tqdm=True),
         
     | 
| 86 | 
         
             
            ):
         
     | 
| 87 | 
         
            -
                pipe.to(device)
         
     | 
| 88 | 
         
            -
             
     | 
| 89 | 
         
             
                lineart_image = lineart_detector(input_image, coarse=False, image_resolution=1024)
         
     | 
| 90 | 
         
             
                lineart_image_filtered = lineart_image.filter(image_filter)
         
     | 
| 91 | 
         
             
                conditioning_image = lineart_image_filtered.point(lambda p: 255 if p > BINARY_THRESHOLD else 0).convert("L")
         
     | 
| 
         @@ -159,4 +158,4 @@ with gr.Blocks(css=css) as demo: 
     | 
|
| 159 | 
         | 
| 160 | 
         
             
                            εΊε
ΈοΌγ΅γ³γγ«η»εγ―γγΉγ¦[ζ₯ζ¬ε€ε
Έη±γγΌγΏγ»γγοΌε½ζε¦η η©Άθ³ζ逨θ΅οΌγη΅΅ζ¬ηγγ€γγ](http://codh.rois.ac.jp/pmjt/book/200013861/)γγεΌη¨γγΎγγγ""")
         
     | 
| 161 | 
         | 
| 162 | 
         
            -
            demo.queue().launch()
         
     | 
| 
         | 
|
| 56 | 
         
             
            pipe.scheduler = EulerDiscreteScheduler.from_config(
         
     | 
| 57 | 
         
             
                pipe.scheduler.config, use_karras_sigmas=True,
         
     | 
| 58 | 
         
             
            )
         
     | 
| 59 | 
         
            +
            pipe.to(device=device, dtype=torch.float16)
         
     | 
| 60 | 
         
             
            # pipe.unet.to(memory_format=torch.channels_last)
         
     | 
| 61 | 
         
             
            # pipe.controlnet.to(memory_format=torch.channels_last)
         
     | 
| 62 | 
         
             
            # pipe.vae.to(memory_format=torch.channels_last)
         
     | 
| 
         | 
|
| 85 | 
         
             
                randomize_seed: bool = False,
         
     | 
| 86 | 
         
             
                progress=gr.Progress(track_tqdm=True),
         
     | 
| 87 | 
         
             
            ):
         
     | 
| 
         | 
|
| 
         | 
|
| 88 | 
         
             
                lineart_image = lineart_detector(input_image, coarse=False, image_resolution=1024)
         
     | 
| 89 | 
         
             
                lineart_image_filtered = lineart_image.filter(image_filter)
         
     | 
| 90 | 
         
             
                conditioning_image = lineart_image_filtered.point(lambda p: 255 if p > BINARY_THRESHOLD else 0).convert("L")
         
     | 
| 
         | 
|
| 158 | 
         | 
| 159 | 
         
             
                            εΊε
ΈοΌγ΅γ³γγ«η»εγ―γγΉγ¦[ζ₯ζ¬ε€ε
Έη±γγΌγΏγ»γγοΌε½ζε¦η η©Άθ³ζ逨θ΅οΌγη΅΅ζ¬ηγγ€γγ](http://codh.rois.ac.jp/pmjt/book/200013861/)γγεΌη¨γγΎγγγ""")
         
     | 
| 160 | 
         | 
| 161 | 
         
            +
            demo.queue().launch()
         
     |