Abdulrahman1989 commited on
Commit
8e410e5
·
1 Parent(s): ce76f74

Fix the code

Browse files
Files changed (1) hide show
  1. app.py +5 -3
app.py CHANGED
@@ -38,7 +38,7 @@ class GradioApp:
38
  )
39
 
40
  def launch(self):
41
- with gr.Blocks() as interface:
42
  # Input for the prompt at the top
43
  prompt_input = gr.Textbox(label="Input Prompt", elem_id="input_textbox")
44
 
@@ -50,12 +50,14 @@ class GradioApp:
50
  with gr.Column():
51
  image_output = gr.Image(label="Generated Image", elem_id="generated_image")
52
  with gr.Column():
53
- video_output = gr.Video(label="3D Model Video", elem_id="model_video")
54
 
55
  # Generate the image first
56
  def generate_image_and_display(prompt):
 
 
57
  # Generate the image from the prompt
58
- image_data = self.sdxl_generator.generate_image([prompt])[0]
59
  return Image.open(BytesIO(image_data))
60
 
61
  # Generate the 3D after the image is ready
 
38
  )
39
 
40
  def launch(self):
41
+ with gr.Blocks(css="#small_video { width: 400px !important; height: 300px !important; }") as interface:
42
  # Input for the prompt at the top
43
  prompt_input = gr.Textbox(label="Input Prompt", elem_id="input_textbox")
44
 
 
50
  with gr.Column():
51
  image_output = gr.Image(label="Generated Image", elem_id="generated_image")
52
  with gr.Column():
53
+ video_output = gr.Video(label="3D Model Video", elem_id="small_video")
54
 
55
  # Generate the image first
56
  def generate_image_and_display(prompt):
57
+ modified_prompt = prompt + ", isolated, on a plain background, minimal, no extra objects"
58
+ print(modified_prompt)
59
  # Generate the image from the prompt
60
+ image_data = self.sdxl_generator.generate_image([modified_prompt])[0]
61
  return Image.open(BytesIO(image_data))
62
 
63
  # Generate the 3D after the image is ready