mirror of
				https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
				synced 2025-11-04 03:55:05 +00:00 
			
		
		
		
	Make Gradio temp directory if it doesn't exist
Gradio normally creates the temp directory in `pil_to_temp_file()` (861d752a83/gradio/components/base.py (L313)) but since the Gradio implementation of `pil_to_temp_file()` is replaced with `save_pil_to_file()`, the Gradio temp directory should also be created by `save_pil_to_file()` when necessary.
			
			
This commit is contained in:
		
							parent
							
								
									953c3eab7b
								
							
						
					
					
						commit
						299b8096bc
					
				@ -44,6 +44,8 @@ def save_pil_to_file(self, pil_image, dir=None, format="png"):
 | 
			
		||||
 | 
			
		||||
    if shared.opts.temp_dir != "":
 | 
			
		||||
        dir = shared.opts.temp_dir
 | 
			
		||||
    else:
 | 
			
		||||
        os.makedirs(dir, exist_ok=True)
 | 
			
		||||
 | 
			
		||||
    use_metadata = False
 | 
			
		||||
    metadata = PngImagePlugin.PngInfo()
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user