Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -31,8 +31,10 @@ generator = torch.Generator(device="cpu").manual_seed(random.randint(-1, 2147483
|
|
31 |
|
32 |
def plex(prompt,goof):
|
33 |
goof = load_image(goof)
|
|
|
|
|
34 |
hint = make_hint(goof, depth_estimator).unsqueeze(0).to("cpu")
|
35 |
-
negative_prior_prompt = "lowres,text,bad quality,jpeg artifacts,ugly,bad face,extra fingers,blurry,bad anatomy,
|
36 |
image_emb, zero_image_emb = pipe_prior(prompt=prompt, negative_prompt=negative_prior_prompt, generator=generator).to_tuple()
|
37 |
|
38 |
images = pipe(
|
@@ -47,5 +49,5 @@ def plex(prompt,goof):
|
|
47 |
|
48 |
return images
|
49 |
|
50 |
-
iface = gr.Interface(fn=plex,inputs=[gr.Textbox(),gr.Image(type="
|
51 |
iface.launch()
|
|
|
31 |
|
32 |
def plex(prompt,goof):
|
33 |
goof = load_image(goof)
|
34 |
+
goof.convert("RGB")
|
35 |
+
goof.thumbnail((512, 512))
|
36 |
hint = make_hint(goof, depth_estimator).unsqueeze(0).to("cpu")
|
37 |
+
negative_prior_prompt = "lowres,text,bad quality,jpeg artifacts,ugly,bad face,extra fingers,blurry,bad anatomy,extra limbs,fused fingers,long neck,watermark,signature"
|
38 |
image_emb, zero_image_emb = pipe_prior(prompt=prompt, negative_prompt=negative_prior_prompt, generator=generator).to_tuple()
|
39 |
|
40 |
images = pipe(
|
|
|
49 |
|
50 |
return images
|
51 |
|
52 |
+
iface = gr.Interface(fn=plex,inputs=[gr.Textbox(),gr.Image(source="upload",type="filepath")], outputs=gr.Image(), title="Img2Img_SkyV22CntrlNet", description="Running on CPU, very slow!")
|
53 |
iface.launch()
|