Update app.py
Browse files
app.py
CHANGED
|
@@ -190,9 +190,9 @@ def generate_item(user_input, ideas, generate_video=False, max_retries=3):
|
|
| 190 |
|
| 191 |
try:
|
| 192 |
start_time = time.time()
|
| 193 |
-
imagen = client.models.
|
| 194 |
model='imagen-3.0-generate-002',
|
| 195 |
-
|
| 196 |
config=types.GenerateImagesConfig(
|
| 197 |
aspect_ratio="9:16",
|
| 198 |
number_of_images=1
|
|
@@ -683,7 +683,7 @@ def generate_share_links(image_base64, video_base64, caption):
|
|
| 683 |
justify-content: center;
|
| 684 |
margin-top: 10px;
|
| 685 |
">
|
| 686 |
-
<a href="https://www.youtube.com/upload?description={
|
| 687 |
background-color: #ff0000;
|
| 688 |
color: white;
|
| 689 |
padding: 8px 16px;
|
|
@@ -918,7 +918,7 @@ with gr.Blocks(
|
|
| 918 |
label="Generate Video (may take longer)",
|
| 919 |
value=False
|
| 920 |
)
|
| 921 |
-
magic_button = gr.Button("✨
|
| 922 |
|
| 923 |
feed_html = gr.HTML()
|
| 924 |
share_html = gr.HTML(label="Share this item:")
|
|
|
|
| 190 |
|
| 191 |
try:
|
| 192 |
start_time = time.time()
|
| 193 |
+
imagen = client.models.generate_content(
|
| 194 |
model='imagen-3.0-generate-002',
|
| 195 |
+
contents=[image_prompt],
|
| 196 |
config=types.GenerateImagesConfig(
|
| 197 |
aspect_ratio="9:16",
|
| 198 |
number_of_images=1
|
|
|
|
| 683 |
justify-content: center;
|
| 684 |
margin-top: 10px;
|
| 685 |
">
|
| 686 |
+
<a href="https://www.youtube.com/upload?description={encoded_caption}" target="_blank" style="
|
| 687 |
background-color: #ff0000;
|
| 688 |
color: white;
|
| 689 |
padding: 8px 16px;
|
|
|
|
| 918 |
label="Generate Video (may take longer)",
|
| 919 |
value=False
|
| 920 |
)
|
| 921 |
+
magic_button = gr.Button("✨ Create ✨", elem_classes="gr-button")
|
| 922 |
|
| 923 |
feed_html = gr.HTML()
|
| 924 |
share_html = gr.HTML(label="Share this item:")
|