Spaces:
				
			
			
	
			
			
					
		Running
		
	
	
	
			
			
	
	
	
	
		
		
					
		Running
		
	Update app.py
Browse files
    	
        app.py
    CHANGED
    
    | 
         @@ -1,6 +1,7 @@ 
     | 
|
| 1 | 
         
             
            # -*- coding: utf-8 -*-
         
     | 
| 2 | 
         
             
            # ZenCtrl Inpainting Playground (Baseten backend)
         
     | 
| 3 | 
         | 
| 
         | 
|
| 4 | 
         
             
            import os, json, base64, requests
         
     | 
| 5 | 
         
             
            from io import BytesIO
         
     | 
| 6 | 
         
             
            from PIL import Image, ImageDraw
         
     | 
| 
         @@ -29,7 +30,7 @@ def _gen_bg(prompt: str): 
     | 
|
| 29 | 
         
             
                url = url[0] if isinstance(url, list) else url
         
     | 
| 30 | 
         
             
                return Image.open(BytesIO(requests.get(url, timeout=120).content)).convert("RGB")
         
     | 
| 31 | 
         | 
| 32 | 
         
            -
             
     | 
| 33 | 
         
             
            def process_image_and_text(subject_image, adapter_dict, prompt, use_detect, detect_prompt, size=ADAPTER_SIZE, rank=10.0):
         
     | 
| 34 | 
         
             
                seed, guidance_scale, steps = 42, 2.5, 28
         
     | 
| 35 | 
         | 
| 
         @@ -197,4 +198,10 @@ with gr.Blocks(css=css, title="ZenCtrl Inpainting") as demo: 
     | 
|
| 197 | 
         
             
                )
         
     | 
| 198 | 
         | 
| 199 | 
         
             
            # ---------------- Launch ---------------------------------------
         
     | 
| 200 | 
         
            -
             
     | 
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
| 
         | 
|
| 1 | 
         
             
            # -*- coding: utf-8 -*-
         
     | 
| 2 | 
         
             
            # ZenCtrl Inpainting Playground (Baseten backend)
         
     | 
| 3 | 
         | 
| 4 | 
         
            +
            import spaces
         
     | 
| 5 | 
         
             
            import os, json, base64, requests
         
     | 
| 6 | 
         
             
            from io import BytesIO
         
     | 
| 7 | 
         
             
            from PIL import Image, ImageDraw
         
     | 
| 
         | 
|
| 30 | 
         
             
                url = url[0] if isinstance(url, list) else url
         
     | 
| 31 | 
         
             
                return Image.open(BytesIO(requests.get(url, timeout=120).content)).convert("RGB")
         
     | 
| 32 | 
         | 
| 33 | 
         
            +
            #@spaces.GPU
         
     | 
| 34 | 
         
             
            def process_image_and_text(subject_image, adapter_dict, prompt, use_detect, detect_prompt, size=ADAPTER_SIZE, rank=10.0):
         
     | 
| 35 | 
         
             
                seed, guidance_scale, steps = 42, 2.5, 28
         
     | 
| 36 | 
         | 
| 
         | 
|
| 198 | 
         
             
                )
         
     | 
| 199 | 
         | 
| 200 | 
         
             
            # ---------------- Launch ---------------------------------------
         
     | 
| 201 | 
         
            +
             
     | 
| 202 | 
         
            +
            if __name__ == "__main__":
         
     | 
| 203 | 
         
            +
                #init_pipeline()
         
     | 
| 204 | 
         
            +
                demo.launch(
         
     | 
| 205 | 
         
            +
                    debug=True,
         
     | 
| 206 | 
         
            +
                    share=True
         
     | 
| 207 | 
         
            +
                )
         
     |