lichorosario commited on
Commit
9edfe45
·
verified ·
1 Parent(s): 5f454af

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -1
app.py CHANGED
@@ -22,6 +22,7 @@ loras = [
22
  "image": "https://cas-bridge.xethub.hf.co/xet-bridge-us/68dc16c261d2d3954790425b/fd0d3426c2bf644e5cb1f57d38c46e1f5e7d73d342ff4de59f32adac598b8c24?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=cas%2F20251001%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20251001T162333Z&X-Amz-Expires=3600&X-Amz-Signature=6e6c04ddf732b5e1d97ac4766f67911fa4437025b4daeaa8c4cb1117dc56e1d6&X-Amz-SignedHeaders=host&X-Xet-Cas-Uid=63114990af1fce227a3f9f66&response-content-disposition=inline%3B+filename*%3DUTF-8%27%271.png%3B+filename%3D%221.png%22%3B&response-content-type=image%2Fpng&x-id=GetObject&Expires=1759339413&Policy=eyJTdGF0ZW1lbnQiOlt7IkNvbmRpdGlvbiI6eyJEYXRlTGVzc1RoYW4iOnsiQVdTOkVwb2NoVGltZSI6MTc1OTMzOTQxM319LCJSZXNvdXJjZSI6Imh0dHBzOi8vY2FzLWJyaWRnZS54ZXRodWIuaGYuY28veGV0LWJyaWRnZS11cy82OGRjMTZjMjYxZDJkMzk1NDc5MDQyNWIvZmQwZDM0MjZjMmJmNjQ0ZTVjYjFmNTdkMzhjNDZlMWY1ZTdkNzNkMzQyZmY0ZGU1OWYzMmFkYWM1OThiOGMyNCoifV19&Signature=aC0bBvnfu55dVC%7E3eAYOBG8dl0uanzBoMTDcPk0zTGYL7EoRDMuVxY3M3%7E1bXE-OFfpxIoftowQr1zwnXm10pPsG-xB4NV8Kx5wBXrPCBZkYU0-vGCXzeXN79kMnAUwQaCU-LyZPM3-TBXnqAvDjXPYAB0nXBo7rkoM8yYv5VhFDm1Ec3dqU0FoFqXYW5Z4vqtiPPCXRpCvM9uRxio7kpwlXO7cg2BVczyYtBjGBBsZyNvcVa8N%7EmzG06TuZxK3bVTQ7TZfrT5XYDP-HYob3O1%7ETlGhzirVprM27tTzrqUmhHnzLCCGPIbGoevWjyPfXiPSw%7EGw%7E3FIHCZZbwS1Nlw__&Key-Pair-Id=K2L8F4GPSG1IFC",
23
  "trigger_word": "",
24
  "trigger_position": "",
 
25
  "title": "Peter Chan concept art"
26
  },
27
  {
@@ -29,6 +30,7 @@ loras = [
29
  "image": "https://huggingface.co/lichorosario/lobato-qwen-image-lora/resolve/main/images/milei.png",
30
  "trigger_word": "",
31
  "trigger_position": "",
 
32
  "title": "Pablo Lobato"
33
  },
34
  {
@@ -36,12 +38,14 @@ loras = [
36
  "image": "https://huggingface.co/lichorosario/casivaras-qwen-image-lora/resolve/main/images/perros.jpeg",
37
  "trigger_word": "",
38
  "trigger_position": "",
 
39
  "title": "Casivaras"
40
  },
41
  {
42
  "repo": "lichorosario/tosti-qwen-image-lora",
43
  "image": "https://huggingface.co/lichorosario/tosti-qwen-image-lora/resolve/main/images/example_85rpareuq.png",
44
  "trigger_word": "",
 
45
  "title": "Tosti"
46
  },
47
  {
@@ -49,6 +53,7 @@ loras = [
49
  "image": "https://huggingface.co/lichorosario/dott-qwen-image-lora/resolve/main/samples/martha.png",
50
  "trigger_word": "",
51
  "trigger_position": "",
 
52
  "title": "Day of the Tentacle"
53
  },
54
  {
@@ -56,6 +61,7 @@ loras = [
56
  "image": "https://huggingface.co/lichorosario/samhtr-qwen-image-lora/resolve/main/images/example_irn8g38y0.png",
57
  "trigger_word": "",
58
  "trigger_position": "",
 
59
  "title": "Sam and Max hit the road"
60
  },
61
  {
@@ -63,6 +69,7 @@ loras = [
63
  "image": "https://huggingface.co/lichorosario/rtmi-qwen-image-lora/resolve/main/images/lara.png",
64
  "trigger_word": "",
65
  "trigger_position": "",
 
66
  "title": "Return to Monkey Island"
67
  }
68
  ]
@@ -154,8 +161,10 @@ def update_selection(evt: gr.SelectData, aspect_ratio):
154
  aspect_ratio = "9:16"
155
  elif selected_lora["aspect"] == "landscape":
156
  aspect_ratio = "16:9"
157
- else:
158
  aspect_ratio = "1:1"
 
 
159
 
160
  return (
161
  gr.update(placeholder=new_placeholder),
 
22
  "image": "https://cas-bridge.xethub.hf.co/xet-bridge-us/68dc16c261d2d3954790425b/fd0d3426c2bf644e5cb1f57d38c46e1f5e7d73d342ff4de59f32adac598b8c24?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=cas%2F20251001%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20251001T162333Z&X-Amz-Expires=3600&X-Amz-Signature=6e6c04ddf732b5e1d97ac4766f67911fa4437025b4daeaa8c4cb1117dc56e1d6&X-Amz-SignedHeaders=host&X-Xet-Cas-Uid=63114990af1fce227a3f9f66&response-content-disposition=inline%3B+filename*%3DUTF-8%27%271.png%3B+filename%3D%221.png%22%3B&response-content-type=image%2Fpng&x-id=GetObject&Expires=1759339413&Policy=eyJTdGF0ZW1lbnQiOlt7IkNvbmRpdGlvbiI6eyJEYXRlTGVzc1RoYW4iOnsiQVdTOkVwb2NoVGltZSI6MTc1OTMzOTQxM319LCJSZXNvdXJjZSI6Imh0dHBzOi8vY2FzLWJyaWRnZS54ZXRodWIuaGYuY28veGV0LWJyaWRnZS11cy82OGRjMTZjMjYxZDJkMzk1NDc5MDQyNWIvZmQwZDM0MjZjMmJmNjQ0ZTVjYjFmNTdkMzhjNDZlMWY1ZTdkNzNkMzQyZmY0ZGU1OWYzMmFkYWM1OThiOGMyNCoifV19&Signature=aC0bBvnfu55dVC%7E3eAYOBG8dl0uanzBoMTDcPk0zTGYL7EoRDMuVxY3M3%7E1bXE-OFfpxIoftowQr1zwnXm10pPsG-xB4NV8Kx5wBXrPCBZkYU0-vGCXzeXN79kMnAUwQaCU-LyZPM3-TBXnqAvDjXPYAB0nXBo7rkoM8yYv5VhFDm1Ec3dqU0FoFqXYW5Z4vqtiPPCXRpCvM9uRxio7kpwlXO7cg2BVczyYtBjGBBsZyNvcVa8N%7EmzG06TuZxK3bVTQ7TZfrT5XYDP-HYob3O1%7ETlGhzirVprM27tTzrqUmhHnzLCCGPIbGoevWjyPfXiPSw%7EGw%7E3FIHCZZbwS1Nlw__&Key-Pair-Id=K2L8F4GPSG1IFC",
23
  "trigger_word": "",
24
  "trigger_position": "",
25
+ "aspect": "landscape",
26
  "title": "Peter Chan concept art"
27
  },
28
  {
 
30
  "image": "https://huggingface.co/lichorosario/lobato-qwen-image-lora/resolve/main/images/milei.png",
31
  "trigger_word": "",
32
  "trigger_position": "",
33
+ "aspect": "landscape",
34
  "title": "Pablo Lobato"
35
  },
36
  {
 
38
  "image": "https://huggingface.co/lichorosario/casivaras-qwen-image-lora/resolve/main/images/perros.jpeg",
39
  "trigger_word": "",
40
  "trigger_position": "",
41
+ "aspect": "portrait",
42
  "title": "Casivaras"
43
  },
44
  {
45
  "repo": "lichorosario/tosti-qwen-image-lora",
46
  "image": "https://huggingface.co/lichorosario/tosti-qwen-image-lora/resolve/main/images/example_85rpareuq.png",
47
  "trigger_word": "",
48
+ "aspect": "square",
49
  "title": "Tosti"
50
  },
51
  {
 
53
  "image": "https://huggingface.co/lichorosario/dott-qwen-image-lora/resolve/main/samples/martha.png",
54
  "trigger_word": "",
55
  "trigger_position": "",
56
+ "aspect": "landscape",
57
  "title": "Day of the Tentacle"
58
  },
59
  {
 
61
  "image": "https://huggingface.co/lichorosario/samhtr-qwen-image-lora/resolve/main/images/example_irn8g38y0.png",
62
  "trigger_word": "",
63
  "trigger_position": "",
64
+ "aspect": "landscape",
65
  "title": "Sam and Max hit the road"
66
  },
67
  {
 
69
  "image": "https://huggingface.co/lichorosario/rtmi-qwen-image-lora/resolve/main/images/lara.png",
70
  "trigger_word": "",
71
  "trigger_position": "",
72
+ "aspect": "landscape",
73
  "title": "Return to Monkey Island"
74
  }
75
  ]
 
161
  aspect_ratio = "9:16"
162
  elif selected_lora["aspect"] == "landscape":
163
  aspect_ratio = "16:9"
164
+ elif selected_lora["aspect"] == "square":
165
  aspect_ratio = "1:1"
166
+ else:
167
+ aspect_ratio = selected_lora["aspect"]
168
 
169
  return (
170
  gr.update(placeholder=new_placeholder),