LanHarmony commited on
Commit
a7d5cd6
1 Parent(s): 38624d1

introduce control net

Browse files
Files changed (1) hide show
  1. app.py +7 -7
app.py CHANGED
@@ -109,9 +109,9 @@ class ConversationBot:
109
  def __init__(self):
110
  print("Initializing VisualChatGPT")
111
  self.llm = OpenAI(temperature=0, openai_api_key="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")
112
- self.edit = ImageEditing(device="cuda")
113
- self.i2t = ImageCaptioning(device="cuda")
114
- self.t2i = T2I(device="cuda")
115
  # self.image2canny = image2canny()
116
  # self.canny2image = canny2image(device="cuda:1")
117
  # self.image2line = image2line()
@@ -129,7 +129,7 @@ class ConversationBot:
129
  # self.depth2image = depth2image(device="cuda:7")
130
  # self.image2normal = image2normal()
131
  # self.normal2image = normal2image(device="cuda:5")
132
- self.pix2pix = Pix2Pix(device="cuda")
133
  self.memory = ConversationBufferMemory(memory_key="chat_history", output_key='output')
134
  self.tools = [
135
  Tool(name="Get Photo Description", func=self.i2t.inference,
@@ -145,9 +145,9 @@ class ConversationBot:
145
  description="useful for when you want to replace an object from the object description or location with another object from its description. "
146
  "The input to this tool should be a comma seperated string of three, representing the image_path, the object to be replaced, the object to be replaced with "),
147
 
148
- Tool(name="Instruct Image Using Text", func=self.pix2pix.inference,
149
- description="useful for when you want to the style of the image to be like the text. like: make it look like a painting. or make it like a robot. "
150
- "The input to this tool should be a comma seperated string of two, representing the image_path and the text. "),
151
  # Tool(name="Answer Question About The Image", func=self.BLIPVQA.get_answer_from_question_and_image,
152
  # description="useful for when you need an answer for a question based on an image. like: what is the background color of the last image, how many cats in this figure, what is in this figure. "
153
  # "The input to this tool should be a comma seperated string of two, representing the image_path and the question"),
 
109
  def __init__(self):
110
  print("Initializing VisualChatGPT")
111
  self.llm = OpenAI(temperature=0, openai_api_key="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")
112
+ self.edit = ImageEditing(device="cuda:0")
113
+ self.i2t = ImageCaptioning(device="cuda:0")
114
+ self.t2i = T2I(device="cuda:0")
115
  # self.image2canny = image2canny()
116
  # self.canny2image = canny2image(device="cuda:1")
117
  # self.image2line = image2line()
 
129
  # self.depth2image = depth2image(device="cuda:7")
130
  # self.image2normal = image2normal()
131
  # self.normal2image = normal2image(device="cuda:5")
132
+ # self.pix2pix = Pix2Pix(device="cuda:0")
133
  self.memory = ConversationBufferMemory(memory_key="chat_history", output_key='output')
134
  self.tools = [
135
  Tool(name="Get Photo Description", func=self.i2t.inference,
 
145
  description="useful for when you want to replace an object from the object description or location with another object from its description. "
146
  "The input to this tool should be a comma seperated string of three, representing the image_path, the object to be replaced, the object to be replaced with "),
147
 
148
+ # Tool(name="Instruct Image Using Text", func=self.pix2pix.inference,
149
+ # description="useful for when you want to the style of the image to be like the text. like: make it look like a painting. or make it like a robot. "
150
+ # "The input to this tool should be a comma seperated string of two, representing the image_path and the text. "),
151
  # Tool(name="Answer Question About The Image", func=self.BLIPVQA.get_answer_from_question_and_image,
152
  # description="useful for when you need an answer for a question based on an image. like: what is the background color of the last image, how many cats in this figure, what is in this figure. "
153
  # "The input to this tool should be a comma seperated string of two, representing the image_path and the question"),