Spaces:
				
			
			
	
			
			
		Running
		
			on 
			
			Zero
	
	
	
			
			
	
	
	
	
		
		
		Running
		
			on 
			
			Zero
	Update app.py
Browse files
    	
        app.py
    CHANGED
    
    | 
         @@ -47,7 +47,7 @@ def update_selection(evt: gr.SelectData): 
     | 
|
| 47 | 
         
             
                    evt.index
         
     | 
| 48 | 
         
             
                )
         
     | 
| 49 | 
         | 
| 50 | 
         
            -
            @spaces.GPU(duration= 
     | 
| 51 | 
         
             
            def generate_image(prompt, trigger_word, steps, seed, cfg_scale, width, height, lora_scale, progress):
         
     | 
| 52 | 
         
             
                pipe.to("cuda")
         
     | 
| 53 | 
         
             
                generator = torch.Generator(device="cuda").manual_seed(seed)
         
     | 
| 
         @@ -90,6 +90,8 @@ def run_lora(prompt, cfg_scale, steps, selected_index, randomize_seed, seed, wid 
     | 
|
| 90 | 
         
             
                pipe.unload_lora_weights()
         
     | 
| 91 | 
         
             
                return image, seed  
         
     | 
| 92 | 
         | 
| 
         | 
|
| 
         | 
|
| 93 | 
         
             
            css = '''
         
     | 
| 94 | 
         
             
            #gen_btn{height: 100%}
         
     | 
| 95 | 
         
             
            #title{text-align: center;}
         
     | 
| 
         | 
|
| 47 | 
         
             
                    evt.index
         
     | 
| 48 | 
         
             
                )
         
     | 
| 49 | 
         | 
| 50 | 
         
            +
            @spaces.GPU(duration=70)
         
     | 
| 51 | 
         
             
            def generate_image(prompt, trigger_word, steps, seed, cfg_scale, width, height, lora_scale, progress):
         
     | 
| 52 | 
         
             
                pipe.to("cuda")
         
     | 
| 53 | 
         
             
                generator = torch.Generator(device="cuda").manual_seed(seed)
         
     | 
| 
         | 
|
| 90 | 
         
             
                pipe.unload_lora_weights()
         
     | 
| 91 | 
         
             
                return image, seed  
         
     | 
| 92 | 
         | 
| 93 | 
         
            +
            run_lora.zerogpu = True
         
     | 
| 94 | 
         
            +
             
     | 
| 95 | 
         
             
            css = '''
         
     | 
| 96 | 
         
             
            #gen_btn{height: 100%}
         
     | 
| 97 | 
         
             
            #title{text-align: center;}
         
     |