Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -90,7 +90,7 @@ def generate_image(
|
|
90 |
|
91 |
if prompt['files']:
|
92 |
#images = Image.open(prompt['files'][-1]).convert('RGB')
|
93 |
-
init_image = load_image(prompt['files'][-1]).resize((
|
94 |
else:
|
95 |
init_image = None
|
96 |
generator = torch.Generator().manual_seed(seed)
|
@@ -114,6 +114,7 @@ def generate_image(
|
|
114 |
guidance_scale=scale,
|
115 |
num_inference_steps=steps,
|
116 |
generator = generator,
|
|
|
117 |
)
|
118 |
return image.images[0]
|
119 |
|
@@ -137,10 +138,10 @@ examples = [
|
|
137 |
|
138 |
with gr.Blocks(css=CSS, js=JS, theme="soft") as demo:
|
139 |
gr.HTML("<h1><center>SD3M🦄</center></h1>")
|
140 |
-
gr.HTML("<p><center><a href='https://huggingface.co/stabilityai/stable-diffusion-3-medium'>sd3m</a> text/
|
141 |
with gr.Group():
|
142 |
with gr.Row():
|
143 |
-
prompt = gr.MultimodalTextbox(label='Enter Your Prompt (Multi-Languages)', interactive=True, placeholder="Enter prompt,
|
144 |
submit = gr.Button(scale=1, variant='primary')
|
145 |
img = gr.Image(label='SD3M Generated Image')
|
146 |
with gr.Accordion("Advanced Options", open=False):
|
|
|
90 |
|
91 |
if prompt['files']:
|
92 |
#images = Image.open(prompt['files'][-1]).convert('RGB')
|
93 |
+
init_image = load_image(prompt['files'][-1]).resize((height, width))
|
94 |
else:
|
95 |
init_image = None
|
96 |
generator = torch.Generator().manual_seed(seed)
|
|
|
114 |
guidance_scale=scale,
|
115 |
num_inference_steps=steps,
|
116 |
generator = generator,
|
117 |
+
max_length=512,
|
118 |
)
|
119 |
return image.images[0]
|
120 |
|
|
|
138 |
|
139 |
with gr.Blocks(css=CSS, js=JS, theme="soft") as demo:
|
140 |
gr.HTML("<h1><center>SD3M🦄</center></h1>")
|
141 |
+
gr.HTML("<p><center><a href='https://huggingface.co/stabilityai/stable-diffusion-3-medium'>sd3m</a> text/image-to-image generation</center></p>")
|
142 |
with gr.Group():
|
143 |
with gr.Row():
|
144 |
+
prompt = gr.MultimodalTextbox(label='Enter Your Prompt (Multi-Languages)', interactive=True, placeholder="Enter prompt, add one image.", file_types=['image'], scale=6)
|
145 |
submit = gr.Button(scale=1, variant='primary')
|
146 |
img = gr.Image(label='SD3M Generated Image')
|
147 |
with gr.Accordion("Advanced Options", open=False):
|