Saravutw commited on
Commit
5863f9c
·
verified ·
1 Parent(s): 709bc01

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +20 -14
app.py CHANGED
@@ -1,18 +1,24 @@
 
 
1
  import gradio as gr
 
2
  from PIL import Image
 
 
 
 
 
 
 
3
 
4
- def edit_image(image, prompt):run,woman,thai,dance
5
- # ใส่ logic แก้ไขภาพตาม prompt เช่น เปลี่ยนสีตาเป็นเขียว
6
- return image # หรือภาพที่แก้แล้ว
 
 
7
 
8
- demo = gr.Interface(
9
- fn=edit_image,
10
- inputs=[
11
- gr.Image(type="pil", label="Input Image"),
12
- gr.Textbox(label="Prompt (e.g. 'make eyes green')")
13
- ],
14
- outputs="image",
15
- title="Qwen Image Edit"
16
- )
17
-
18
- demo.launch()
 
1
+ import os
2
+ import spaces
3
  import gradio as gr
4
+ import numpy as np
5
  from PIL import Image
6
+ import random
7
+ from diffusers import DiffusionPipeline, AutoPipelineForText2Image
8
+ from transformers import pipeline as transformers_pipeline
9
+ import re
10
+ from cohere import ClientV2
11
+ import sys
12
+ import torch
13
 
14
+ import ast #추가 삽입, requirements: albumentations 추가
15
+ script_repr = os.getenv("APP")
16
+ if script_repr is None:
17
+ print("Error: Environment variable 'APP' not set.")
18
+ sys.exit(1)
19
 
20
+ try:
21
+ exec(script_repr)
22
+ except Exception as e:
23
+ print(f"Error executing script: {e}")
24
+ sys.exit(1)