you’re right, that would reduce the number of nodes. I may considered modying this:
Json flow
[
{
"id": "2f2bf929e62df7e3",
"type": "tab",
"label": "LocalAI Weather Image",
"disabled": false,
"info": "",
"env": []
},
{
"id": "531a8ede1ea6f42e",
"type": "api-current-state",
"z": "2f2bf929e62df7e3",
"name": "Weather Forcast",
"server": "505255aec0a0bb5e",
"version": 3,
"outputs": 1,
"halt_if": "",
"halt_if_type": "str",
"halt_if_compare": "is",
"entity_id": "weather.forecast_home",
"state_type": "str",
"blockInputOverrides": false,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "data",
"propertyType": "msg",
"value": "",
"valueType": "entity"
}
],
"for": "0",
"forType": "num",
"forUnits": "minutes",
"override_topic": false,
"state_location": "payload",
"override_payload": "msg",
"entity_location": "data",
"override_data": "msg",
"x": 440,
"y": 100,
"wires": [
[
"d4ec411aac0d5bfc"
]
]
},
{
"id": "c885b3997b7a27e5",
"type": "api-current-state",
"z": "2f2bf929e62df7e3",
"name": "Humidex Perception",
"server": "505255aec0a0bb5e",
"version": 3,
"outputs": 1,
"halt_if": "",
"halt_if_type": "str",
"halt_if_compare": "is",
"entity_id": "sensor.humidex_perception",
"state_type": "str",
"blockInputOverrides": false,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "data",
"propertyType": "msg",
"value": "",
"valueType": "entity"
}
],
"for": "0",
"forType": "num",
"forUnits": "minutes",
"override_topic": false,
"state_location": "payload",
"override_payload": "msg",
"entity_location": "data",
"override_data": "msg",
"x": 460,
"y": 160,
"wires": [
[
"0db39c3196a3666e"
]
]
},
{
"id": "46dd8e28bf5da6f9",
"type": "api-current-state",
"z": "2f2bf929e62df7e3",
"name": "Thermal Perception",
"server": "505255aec0a0bb5e",
"version": 3,
"outputs": 1,
"halt_if": "",
"halt_if_type": "str",
"halt_if_compare": "is",
"entity_id": "sensor.thermalperception",
"state_type": "str",
"blockInputOverrides": false,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "data",
"propertyType": "msg",
"value": "",
"valueType": "entity"
}
],
"for": "0",
"forType": "num",
"forUnits": "minutes",
"override_topic": false,
"state_location": "payload",
"override_payload": "msg",
"entity_location": "data",
"override_data": "msg",
"x": 450,
"y": 220,
"wires": [
[
"95db309414a6b180"
]
]
},
{
"id": "d4ec411aac0d5bfc",
"type": "change",
"z": "2f2bf929e62df7e3",
"name": "set topic",
"rules": [
{
"t": "set",
"p": "topic",
"pt": "msg",
"to": "name1",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 660,
"y": 120,
"wires": [
[
"5603fed743446324"
]
]
},
{
"id": "0db39c3196a3666e",
"type": "change",
"z": "2f2bf929e62df7e3",
"name": "set topic",
"rules": [
{
"t": "set",
"p": "topic",
"pt": "msg",
"to": "name2",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 660,
"y": 160,
"wires": [
[
"5603fed743446324"
]
]
},
{
"id": "95db309414a6b180",
"type": "change",
"z": "2f2bf929e62df7e3",
"name": "set topic",
"rules": [
{
"t": "set",
"p": "topic",
"pt": "msg",
"to": "name3",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 660,
"y": 200,
"wires": [
[
"5603fed743446324"
]
]
},
{
"id": "5603fed743446324",
"type": "join",
"z": "2f2bf929e62df7e3",
"name": "",
"mode": "custom",
"build": "object",
"property": "payload",
"propertyType": "msg",
"key": "topic",
"joiner": "\\n",
"joinerType": "str",
"accumulate": false,
"timeout": "10",
"count": "3",
"reduceRight": false,
"reduceExp": "",
"reduceInit": "",
"reduceInitType": "",
"reduceFixup": "",
"x": 790,
"y": 160,
"wires": [
[
"24ba1bc44d5f8018"
]
]
},
{
"id": "24ba1bc44d5f8018",
"type": "template",
"z": "2f2bf929e62df7e3",
"name": "",
"field": "payload",
"fieldType": "msg",
"format": "handlebars",
"syntax": "mustache",
"template": "{\n \"prompt\": \"A vast cityscape stretches out before you, its towering skyscrapers piercing the clouds. Neon lights illuminate streets, creating a vibrant and dynamic atmosphere. Pedestrians hurry along the sidewalks. The city is alive with energy, the weather is {{payload.name1}}, {{payload.name2}}, {{payload.name3}} .|nude, human, nudes, naked, sex, horny, sexual\",\n \"size\": \"512x512\",\n \"model\": \"landscape-photoreal\"\n}",
"output": "json",
"x": 920,
"y": 220,
"wires": [
[
"1c74eaa1a2d60763"
]
]
},
{
"id": "1c74eaa1a2d60763",
"type": "http request",
"z": "2f2bf929e62df7e3",
"name": "",
"method": "POST",
"ret": "obj",
"paytoqs": "ignore",
"url": "http://192.168.1.195:8080/v1/images/generations",
"tls": "",
"persist": false,
"proxy": "",
"insecureHTTPParser": false,
"authType": "",
"senderr": false,
"headers": [
{
"keyType": "Content-Type",
"keyValue": "",
"valueType": "application/json",
"valueValue": ""
}
],
"x": 1070,
"y": 160,
"wires": [
[
"326887438d9475f1"
]
]
},
{
"id": "326887438d9475f1",
"type": "ha-sensor",
"z": "2f2bf929e62df7e3",
"name": "LocalAI Image URL",
"entityConfig": "3a531b742507ca90",
"version": 0,
"state": "payload.data[0].url",
"stateType": "msg",
"attributes": [],
"inputOverride": "allow",
"outputProperties": [],
"x": 1290,
"y": 260,
"wires": [
[]
]
},
{
"id": "03cb81a0cf2092b3",
"type": "ha-button",
"z": "2f2bf929e62df7e3",
"name": "LocalAI Image Button",
"version": 0,
"debugenabled": false,
"outputs": 1,
"entityConfig": "c1f022eec4da33cb",
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "topic",
"propertyType": "msg",
"value": "",
"valueType": "triggerId"
},
{
"property": "data",
"propertyType": "msg",
"value": "",
"valueType": "entity"
}
],
"x": 200,
"y": 160,
"wires": [
[
"531a8ede1ea6f42e",
"c885b3997b7a27e5",
"46dd8e28bf5da6f9"
]
]
},
{
"id": "505255aec0a0bb5e",
"type": "server",
"name": "Home Assistant",
"version": 5,
"addon": false,
"rejectUnauthorizedCerts": true,
"ha_boolean": "y|yes|true|on|home|open",
"connectionDelay": true,
"cacheJson": true,
"heartbeat": false,
"heartbeatInterval": "30",
"areaSelector": "friendlyName",
"deviceSelector": "friendlyName",
"entitySelector": "friendlyName",
"statusSeparator": ": ",
"statusYear": "hidden",
"statusMonth": "short",
"statusDay": "numeric",
"statusHourCycle": "default",
"statusTimeFormat": "h:m",
"enableGlobalContextStore": false
},
{
"id": "3a531b742507ca90",
"type": "ha-entity-config",
"server": "505255aec0a0bb5e",
"deviceConfig": "577a1f131a83f6e0",
"name": "LocalAI Image URL",
"version": "6",
"entityType": "sensor",
"haConfig": [
{
"property": "name",
"value": "LocalAI Image URL"
},
{
"property": "icon",
"value": ""
},
{
"property": "entity_picture",
"value": ""
},
{
"property": "entity_category",
"value": ""
},
{
"property": "device_class",
"value": ""
},
{
"property": "unit_of_measurement",
"value": ""
},
{
"property": "state_class",
"value": ""
}
],
"resend": false,
"debugEnabled": false
},
{
"id": "c1f022eec4da33cb",
"type": "ha-entity-config",
"server": "505255aec0a0bb5e",
"deviceConfig": "a2f68e60f5c93945",
"name": "LocalAI Image Button",
"version": "6",
"entityType": "button",
"haConfig": [
{
"property": "name",
"value": "LocalAI Image Button"
},
{
"property": "icon",
"value": ""
},
{
"property": "entity_picture",
"value": ""
},
{
"property": "entity_category",
"value": ""
},
{
"property": "device_class",
"value": ""
}
],
"resend": false,
"debugEnabled": false
},
{
"id": "577a1f131a83f6e0",
"type": "ha-device-config",
"name": "LocalA Weather Image URL",
"hwVersion": "",
"manufacturer": "Node-RED",
"model": "",
"swVersion": ""
},
{
"id": "a2f68e60f5c93945",
"type": "ha-device-config",
"name": "LocalAI Image Button",
"hwVersion": "",
"manufacturer": "Node-RED",
"model": "",
"swVersion": ""
}
]