update
Browse files- client/src/layouts/config.js +82 -82
- server/api_clients.py +1 -1
client/src/layouts/config.js
CHANGED
|
@@ -1,111 +1,111 @@
|
|
| 1 |
// Layout settings for different types
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
export const LAYOUTS = {
|
| 3 |
COVER: {
|
| 4 |
gridCols: 1,
|
| 5 |
gridRows: 1,
|
| 6 |
panels: [
|
| 7 |
-
{ width:
|
| 8 |
],
|
| 9 |
},
|
| 10 |
LAYOUT_1: {
|
| 11 |
-
gridCols:
|
| 12 |
-
gridRows:
|
| 13 |
panels: [
|
| 14 |
-
{ width:
|
|
|
|
|
|
|
|
|
|
| 15 |
],
|
| 16 |
},
|
| 17 |
LAYOUT_2: {
|
| 18 |
-
gridCols:
|
| 19 |
-
gridRows:
|
| 20 |
panels: [
|
| 21 |
-
{ width:
|
|
|
|
|
|
|
| 22 |
],
|
| 23 |
},
|
| 24 |
LAYOUT_3: {
|
| 25 |
-
gridCols:
|
| 26 |
-
gridRows:
|
| 27 |
panels: [
|
| 28 |
-
{ width:
|
|
|
|
|
|
|
|
|
|
| 29 |
],
|
| 30 |
},
|
| 31 |
LAYOUT_4: {
|
| 32 |
-
gridCols:
|
| 33 |
-
gridRows:
|
| 34 |
panels: [
|
| 35 |
-
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 36 |
],
|
| 37 |
},
|
| 38 |
};
|
| 39 |
|
| 40 |
-
// export const LAYOUTS = {
|
| 41 |
-
// COVER: {
|
| 42 |
-
// gridCols: 1,
|
| 43 |
-
// gridRows: 1,
|
| 44 |
-
// panels: [
|
| 45 |
-
// { width: 1024, height: 512, gridColumn: "1", gridRow: "1" }, // Format pleine page (1:1 ratio)
|
| 46 |
-
// ],
|
| 47 |
-
// },
|
| 48 |
-
// LAYOUT_1: {
|
| 49 |
-
// gridCols: 2,
|
| 50 |
-
// gridRows: 2,
|
| 51 |
-
// panels: [
|
| 52 |
-
// { width: 1024, height: 768, gridColumn: "1", gridRow: "1" }, // 1. Landscape top left
|
| 53 |
-
// { width: 768, height: 1024, gridColumn: "2", gridRow: "1" }, // 2. Portrait top right
|
| 54 |
-
// { width: 1024, height: 768, gridColumn: "1", gridRow: "2" }, // 3. Landscape middle left
|
| 55 |
-
// { width: 768, height: 1024, gridColumn: "2", gridRow: "2" }, // 4. Portrait right, spans bottom rows
|
| 56 |
-
// ],
|
| 57 |
-
// },
|
| 58 |
-
// LAYOUT_2: {
|
| 59 |
-
// gridCols: 3,
|
| 60 |
-
// gridRows: 2,
|
| 61 |
-
// panels: [
|
| 62 |
-
// { width: 1024, height: 1024, gridColumn: "1 / span 2", gridRow: "1" }, // 1. Large square top left
|
| 63 |
-
// { width: 512, height: 1024, gridColumn: "3", gridRow: "1" }, // 2. Portrait top right
|
| 64 |
-
// { width: 1024, height: 768, gridColumn: "1 / span 3", gridRow: "2" }, // 3. Landscape bottom, spans full width
|
| 65 |
-
// ],
|
| 66 |
-
// },
|
| 67 |
-
// LAYOUT_3: {
|
| 68 |
-
// gridCols: 3,
|
| 69 |
-
// gridRows: 2,
|
| 70 |
-
// panels: [
|
| 71 |
-
// { width: 1024, height: 768, gridColumn: "1 / span 2", gridRow: "1" }, // 1. Landscape top left, spans 2 columns
|
| 72 |
-
// { width: 512, height: 1024, gridColumn: "3", gridRow: "1" }, // 2. Portrait top right
|
| 73 |
-
// { width: 512, height: 1024, gridColumn: "1", gridRow: "2" }, // 3. Portrait bottom left
|
| 74 |
-
// { width: 1024, height: 768, gridColumn: "2 / span 2", gridRow: "2" }, // 4. Landscape bottom right, spans 2 columns
|
| 75 |
-
// ],
|
| 76 |
-
// },
|
| 77 |
-
// LAYOUT_4: {
|
| 78 |
-
// gridCols: 8,
|
| 79 |
-
// gridRows: 8,
|
| 80 |
-
// panels: [
|
| 81 |
-
// {
|
| 82 |
-
// width: 768,
|
| 83 |
-
// height: 768,
|
| 84 |
-
// gridColumn: "1 / span 3",
|
| 85 |
-
// gridRow: "1 / span 3",
|
| 86 |
-
// }, // 1. Square top left
|
| 87 |
-
// {
|
| 88 |
-
// width: 768,
|
| 89 |
-
// height: 1024,
|
| 90 |
-
// gridColumn: "1 / span 3",
|
| 91 |
-
// gridRow: "4 / span 5",
|
| 92 |
-
// }, // 2. Long portrait bottom left
|
| 93 |
-
// {
|
| 94 |
-
// width: 768,
|
| 95 |
-
// height: 1024,
|
| 96 |
-
// gridColumn: "5 / span 3",
|
| 97 |
-
// gridRow: "1 / span 5",
|
| 98 |
-
// }, // 3. Long portrait top right
|
| 99 |
-
// {
|
| 100 |
-
// width: 768,
|
| 101 |
-
// height: 768,
|
| 102 |
-
// gridColumn: "5 / span 3",
|
| 103 |
-
// gridRow: "6 / span 3",
|
| 104 |
-
// }, // 4. Square bottom right
|
| 105 |
-
// ],
|
| 106 |
-
// },
|
| 107 |
-
// };
|
| 108 |
-
|
| 109 |
export const defaultLayout = "LAYOUT_1";
|
| 110 |
export const nonRandomLayouts = Object.keys(LAYOUTS).filter(
|
| 111 |
(layout) => layout !== "random"
|
|
|
|
| 1 |
// Layout settings for different types
|
| 2 |
+
// export const LAYOUTS = {
|
| 3 |
+
// COVER: {
|
| 4 |
+
// gridCols: 1,
|
| 5 |
+
// gridRows: 1,
|
| 6 |
+
// panels: [
|
| 7 |
+
// { width: 512, height: 1024, gridColumn: "1", gridRow: "1" }, // Format pleine page (1:1 ratio)
|
| 8 |
+
// ],
|
| 9 |
+
// },
|
| 10 |
+
// LAYOUT_1: {
|
| 11 |
+
// gridCols: 1,
|
| 12 |
+
// gridRows: 1,
|
| 13 |
+
// panels: [
|
| 14 |
+
// { width: 512, height: 1024, gridColumn: "1", gridRow: "1" }, // Format pleine page (1:1 ratio)
|
| 15 |
+
// ],
|
| 16 |
+
// },
|
| 17 |
+
// LAYOUT_2: {
|
| 18 |
+
// gridCols: 1,
|
| 19 |
+
// gridRows: 1,
|
| 20 |
+
// panels: [
|
| 21 |
+
// { width: 512, height: 1024, gridColumn: "1", gridRow: "1" }, // Format pleine page (1:1 ratio)
|
| 22 |
+
// ],
|
| 23 |
+
// },
|
| 24 |
+
// LAYOUT_3: {
|
| 25 |
+
// gridCols: 1,
|
| 26 |
+
// gridRows: 1,
|
| 27 |
+
// panels: [
|
| 28 |
+
// { width: 512, height: 1024, gridColumn: "1", gridRow: "1" }, // Format pleine page (1:1 ratio)
|
| 29 |
+
// ],
|
| 30 |
+
// },
|
| 31 |
+
// LAYOUT_4: {
|
| 32 |
+
// gridCols: 1,
|
| 33 |
+
// gridRows: 1,
|
| 34 |
+
// panels: [
|
| 35 |
+
// { width: 512, height: 1024, gridColumn: "1", gridRow: "1" }, // Format pleine page (1:1 ratio)
|
| 36 |
+
// ],
|
| 37 |
+
// },
|
| 38 |
+
// };
|
| 39 |
+
|
| 40 |
export const LAYOUTS = {
|
| 41 |
COVER: {
|
| 42 |
gridCols: 1,
|
| 43 |
gridRows: 1,
|
| 44 |
panels: [
|
| 45 |
+
{ width: 1024, height: 512, gridColumn: "1", gridRow: "1" }, // Format pleine page (1:1 ratio)
|
| 46 |
],
|
| 47 |
},
|
| 48 |
LAYOUT_1: {
|
| 49 |
+
gridCols: 2,
|
| 50 |
+
gridRows: 2,
|
| 51 |
panels: [
|
| 52 |
+
{ width: 1024, height: 768, gridColumn: "1", gridRow: "1" }, // 1. Landscape top left
|
| 53 |
+
{ width: 768, height: 1024, gridColumn: "2", gridRow: "1" }, // 2. Portrait top right
|
| 54 |
+
{ width: 1024, height: 768, gridColumn: "1", gridRow: "2" }, // 3. Landscape middle left
|
| 55 |
+
{ width: 768, height: 1024, gridColumn: "2", gridRow: "2" }, // 4. Portrait right, spans bottom rows
|
| 56 |
],
|
| 57 |
},
|
| 58 |
LAYOUT_2: {
|
| 59 |
+
gridCols: 3,
|
| 60 |
+
gridRows: 2,
|
| 61 |
panels: [
|
| 62 |
+
{ width: 1024, height: 1024, gridColumn: "1 / span 2", gridRow: "1" }, // 1. Large square top left
|
| 63 |
+
{ width: 512, height: 1024, gridColumn: "3", gridRow: "1" }, // 2. Portrait top right
|
| 64 |
+
{ width: 1024, height: 768, gridColumn: "1 / span 3", gridRow: "2" }, // 3. Landscape bottom, spans full width
|
| 65 |
],
|
| 66 |
},
|
| 67 |
LAYOUT_3: {
|
| 68 |
+
gridCols: 3,
|
| 69 |
+
gridRows: 2,
|
| 70 |
panels: [
|
| 71 |
+
{ width: 1024, height: 768, gridColumn: "1 / span 2", gridRow: "1" }, // 1. Landscape top left, spans 2 columns
|
| 72 |
+
{ width: 512, height: 1024, gridColumn: "3", gridRow: "1" }, // 2. Portrait top right
|
| 73 |
+
{ width: 512, height: 1024, gridColumn: "1", gridRow: "2" }, // 3. Portrait bottom left
|
| 74 |
+
{ width: 1024, height: 768, gridColumn: "2 / span 2", gridRow: "2" }, // 4. Landscape bottom right, spans 2 columns
|
| 75 |
],
|
| 76 |
},
|
| 77 |
LAYOUT_4: {
|
| 78 |
+
gridCols: 8,
|
| 79 |
+
gridRows: 8,
|
| 80 |
panels: [
|
| 81 |
+
{
|
| 82 |
+
width: 768,
|
| 83 |
+
height: 768,
|
| 84 |
+
gridColumn: "1 / span 3",
|
| 85 |
+
gridRow: "1 / span 3",
|
| 86 |
+
}, // 1. Square top left
|
| 87 |
+
{
|
| 88 |
+
width: 768,
|
| 89 |
+
height: 1024,
|
| 90 |
+
gridColumn: "1 / span 3",
|
| 91 |
+
gridRow: "4 / span 5",
|
| 92 |
+
}, // 2. Long portrait bottom left
|
| 93 |
+
{
|
| 94 |
+
width: 768,
|
| 95 |
+
height: 1024,
|
| 96 |
+
gridColumn: "5 / span 3",
|
| 97 |
+
gridRow: "1 / span 5",
|
| 98 |
+
}, // 3. Long portrait top right
|
| 99 |
+
{
|
| 100 |
+
width: 768,
|
| 101 |
+
height: 768,
|
| 102 |
+
gridColumn: "5 / span 3",
|
| 103 |
+
gridRow: "6 / span 3",
|
| 104 |
+
}, // 4. Square bottom right
|
| 105 |
],
|
| 106 |
},
|
| 107 |
};
|
| 108 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 109 |
export const defaultLayout = "LAYOUT_1";
|
| 110 |
export const nonRandomLayouts = Object.keys(LAYOUTS).filter(
|
| 111 |
(layout) => layout !== "random"
|
server/api_clients.py
CHANGED
|
@@ -67,7 +67,7 @@ class FluxClient:
|
|
| 67 |
prompt: str,
|
| 68 |
width: int,
|
| 69 |
height: int,
|
| 70 |
-
num_inference_steps: int =
|
| 71 |
guidance_scale: float = 9.0) -> Optional[bytes]:
|
| 72 |
"""Génère une image à partir d'un prompt."""
|
| 73 |
try:
|
|
|
|
| 67 |
prompt: str,
|
| 68 |
width: int,
|
| 69 |
height: int,
|
| 70 |
+
num_inference_steps: int = 3,
|
| 71 |
guidance_scale: float = 9.0) -> Optional[bytes]:
|
| 72 |
"""Génère une image à partir d'un prompt."""
|
| 73 |
try:
|