Merge pull request #12 from daoleno/main
add debug info if server encounters an error
This commit is contained in:
		
						commit
						3f189b2ef6
					
				@ -18,6 +18,9 @@ def generation():
 | 
				
			|||||||
        "input": {"prompt": prompt, "steps": 28, "negative_prompt": negative_prompt, "width": 512, "height": 768, "sampler_index": "DPM++ SDE Karras",
 | 
					        "input": {"prompt": prompt, "steps": 28, "negative_prompt": negative_prompt, "width": 512, "height": 768, "sampler_index": "DPM++ SDE Karras",
 | 
				
			||||||
                  "batch_size": 1, "seed": -1},
 | 
					                  "batch_size": 1, "seed": -1},
 | 
				
			||||||
    })
 | 
					    })
 | 
				
			||||||
 | 
					    if res.status_code != 200:
 | 
				
			||||||
 | 
					        print(f"request failed: url: {res.url}, status code: {res.status_code}, text: {res.text}")
 | 
				
			||||||
 | 
					        return
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    task_id = res.json()['id']
 | 
					    task_id = res.json()['id']
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -26,6 +29,9 @@ def generation():
 | 
				
			|||||||
            'Content-Type': 'application/json',
 | 
					            'Content-Type': 'application/json',
 | 
				
			||||||
            "Authorization": f"Bearer {runpod_key}"
 | 
					            "Authorization": f"Bearer {runpod_key}"
 | 
				
			||||||
        })
 | 
					        })
 | 
				
			||||||
 | 
					        if res.status_code != 200:
 | 
				
			||||||
 | 
					            print(f"request failed: url: {res.url}, status code: {res.status_code}, text: {res.text}")
 | 
				
			||||||
 | 
					            break
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        status = res.json()['status']
 | 
					        status = res.json()['status']
 | 
				
			||||||
        print(status)
 | 
					        print(status)
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user