Spaces:
Running
on
Zero
Running
on
Zero
mrbeliever
commited on
Commit
•
ecc9f91
1
Parent(s):
48d37f2
Update flux1_img2img.py
Browse files- flux1_img2img.py +2 -3
flux1_img2img.py
CHANGED
@@ -10,9 +10,8 @@ import spaces
|
|
10 |
@spaces.GPU
|
11 |
def process_image(image,mask_image,prompt="a person",model_id="black-forest-labs/FLUX.1-schnell",strength=0.75,seed=0,num_inference_steps=4):
|
12 |
print("start process image process_image")
|
13 |
-
if image
|
14 |
-
|
15 |
-
return None
|
16 |
|
17 |
pipe = FluxImg2ImgPipeline.from_pretrained(model_id, torch_dtype=torch.bfloat16)
|
18 |
pipe.to("cuda")
|
|
|
10 |
@spaces.GPU
|
11 |
def process_image(image,mask_image,prompt="a person",model_id="black-forest-labs/FLUX.1-schnell",strength=0.75,seed=0,num_inference_steps=4):
|
12 |
print("start process image process_image")
|
13 |
+
if image is None or not hasattr(image, 'size'):
|
14 |
+
raise gr.Error("Please upload an image.")
|
|
|
15 |
|
16 |
pipe = FluxImg2ImgPipeline.from_pretrained(model_id, torch_dtype=torch.bfloat16)
|
17 |
pipe.to("cuda")
|