-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathButton_abort.gd
54 lines (29 loc) · 1.01 KB
/
Button_abort.gd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
extends Button
@onready var g_node_sdimage = $"../../HSplitContainer/TextureRect_sdimage"
var g_busy = false
# Called when the node enters the scene tree for the first time.
#func _ready():
#pass # Replace with function body.
#
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
pass
func _ready():
pass # _ready
## BEGIN CRITICAL
func get_api_url_interrupt():
var the_url = "http://127.0.0.1:7860/sdapi/v1/interrupt"
return the_url
## END CRITICAL
func _on_button_up():
var payload = {
}
SD_send_POST_request(get_api_url_interrupt(), payload, done_request)
func SD_send_POST_request(url, payload, callback_func):
$HTTPRequest.request_completed.connect(callback_func)
var send_request = $HTTPRequest.request(url,[],HTTPClient.METHOD_POST, JSON.stringify(payload)) # what do we want to connect to
if send_request != OK:
print("ERROR sending request")
func done_request(result, response_code, headers, body):
print("done interrupting")
pass