Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -99,8 +99,8 @@ def king(type ,
|
|
| 99 |
prompt = instruction,
|
| 100 |
guidance_scale = guidance_scale,
|
| 101 |
num_inference_steps = steps,
|
| 102 |
-
width = (width
|
| 103 |
-
height = (height
|
| 104 |
generator = generator,
|
| 105 |
output_type="latent",
|
| 106 |
).images
|
|
@@ -109,8 +109,6 @@ def king(type ,
|
|
| 109 |
prompt=instruction,
|
| 110 |
guidance_scale=guidance_scale,
|
| 111 |
num_inference_steps=steps,
|
| 112 |
-
width = (width*2),
|
| 113 |
-
height = (height*2),
|
| 114 |
image=image,
|
| 115 |
generator=generator,
|
| 116 |
).images[0]
|
|
@@ -133,7 +131,10 @@ def response(instruction, input_image=None ):
|
|
| 133 |
else:
|
| 134 |
output = "Image Generation"
|
| 135 |
except error:
|
| 136 |
-
|
|
|
|
|
|
|
|
|
|
| 137 |
return output
|
| 138 |
|
| 139 |
css = '''
|
|
@@ -166,8 +167,7 @@ examples=[
|
|
| 166 |
[
|
| 167 |
"Image Generation",
|
| 168 |
None,
|
| 169 |
-
"An alien grasping a sign board contain word 'ALIEN', futuristic, neonpunk,
|
| 170 |
-
|
| 171 |
],
|
| 172 |
[
|
| 173 |
"Image Generation",
|
|
@@ -179,10 +179,10 @@ examples=[
|
|
| 179 |
with gr.Blocks(css=css) as demo:
|
| 180 |
gr.Markdown("# Image Generator Pro")
|
| 181 |
with gr.Row():
|
| 182 |
-
with gr.Column(scale=
|
| 183 |
instruction = gr.Textbox(lines=1, label="Instruction", interactive=True)
|
| 184 |
with gr.Column(scale=1):
|
| 185 |
-
type = gr.Dropdown(["Image Generation","Image Editing"], label="Task", value="Image Generation",interactive=True
|
| 186 |
with gr.Column(scale=1):
|
| 187 |
generate_button = gr.Button("Generate")
|
| 188 |
|
|
|
|
| 99 |
prompt = instruction,
|
| 100 |
guidance_scale = guidance_scale,
|
| 101 |
num_inference_steps = steps,
|
| 102 |
+
width = (width),
|
| 103 |
+
height = (height),
|
| 104 |
generator = generator,
|
| 105 |
output_type="latent",
|
| 106 |
).images
|
|
|
|
| 109 |
prompt=instruction,
|
| 110 |
guidance_scale=guidance_scale,
|
| 111 |
num_inference_steps=steps,
|
|
|
|
|
|
|
| 112 |
image=image,
|
| 113 |
generator=generator,
|
| 114 |
).images[0]
|
|
|
|
| 131 |
else:
|
| 132 |
output = "Image Generation"
|
| 133 |
except error:
|
| 134 |
+
if input_image is None:
|
| 135 |
+
output="Image Generation"
|
| 136 |
+
else:
|
| 137 |
+
output="Image Editing"
|
| 138 |
return output
|
| 139 |
|
| 140 |
css = '''
|
|
|
|
| 167 |
[
|
| 168 |
"Image Generation",
|
| 169 |
None,
|
| 170 |
+
"An alien grasping a sign board contain word 'ALIEN' with Neon Glow, neon, futuristic, neonpunk, neon lights",
|
|
|
|
| 171 |
],
|
| 172 |
[
|
| 173 |
"Image Generation",
|
|
|
|
| 179 |
with gr.Blocks(css=css) as demo:
|
| 180 |
gr.Markdown("# Image Generator Pro")
|
| 181 |
with gr.Row():
|
| 182 |
+
with gr.Column(scale=3):
|
| 183 |
instruction = gr.Textbox(lines=1, label="Instruction", interactive=True)
|
| 184 |
with gr.Column(scale=1):
|
| 185 |
+
type = gr.Dropdown(["Image Generation","Image Editing"], label="Task", value="Image Generation",interactive=True)
|
| 186 |
with gr.Column(scale=1):
|
| 187 |
generate_button = gr.Button("Generate")
|
| 188 |
|