File tree Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ def __initVal(self):
3636 self .__number_of_images_to_create = CONFIG_MANAGER .get_replicate_property ('number_of_images_to_create' )
3737 self .__save_prompt_as_text = CONFIG_MANAGER .get_replicate_property ('save_prompt_as_text' )
3838
39- self .__wrapper = ReplicateWrapper (self .__api_key )
39+ self .__wrapper = ReplicateWrapper (self .__api_key . strip () if self . __api_key else '' )
4040
4141 def __initUi (self ):
4242 self .__apiKeyLineEdit = QLineEdit ()
@@ -165,8 +165,10 @@ def __initUi(self):
165165 def __replicateChanged (self , v ):
166166 sender = self .sender ()
167167 if sender == self .__apiKeyLineEdit :
168+ v = v .strip () if v else ''
168169 self .__api_key = v
169170 CONFIG_MANAGER .set_replicate_property ('REPLICATE_API_TOKEN' , v )
171+ self .__wrapper .set_api (v )
170172 elif sender == self .__widthSpinBox :
171173 self .__width = v
172174 CONFIG_MANAGER .set_replicate_property ('width' , v )
Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ def set_api(self, api_key):
1818 :param api_key:
1919 :return:
2020 """
21+ print ("API KEY" , api_key )
2122 self .__api_key = api_key
2223 os .environ ['REPLICATE_API_TOKEN' ] = self .__api_key
2324 return True
You can’t perform that action at this time.
0 commit comments