mirror of
https://github.com/Azornes/Comfyui-LayerForge.git
synced 2026-03-22 05:02:11 -03:00
Add LayerForge badge, workflows, and example workflow
Introduces a dynamic LayerForge downloads badge (LAYERFORGE.md), new GitHub Actions for badge generation and improved release versioning, and example workflow files. Updates README to use the new badge and bumps version to 1.3.0 in pyproject.toml. Adds issue templates for bug reports and documentation requests.
This commit is contained in:
98
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
Normal file
98
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
Normal file
@@ -0,0 +1,98 @@
|
||||
name: 🐞 Bug Report
|
||||
description: Report an error or unexpected behavior
|
||||
title: "[BUG] "
|
||||
labels: [bug]
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
**Thank you for reporting a bug!**
|
||||
Please follow these steps to capture useful info:
|
||||
|
||||
### How to gather the necessary information:
|
||||
🌐 **Browser & Version:**
|
||||
- Chrome: Click the three dots → Help → About Google Chrome
|
||||
- Firefox: Click the three bars → Help → About Firefox
|
||||
- Edge: Click the three dots → Help and feedback → About Microsoft Edge
|
||||
|
||||
🔗 **Where to find the latest versions of ComfyUI and LayerForge:**
|
||||
- [ComfyUI Github](https://github.com/comfyanonymous/ComfyUI/releases)
|
||||
- [LayerForge Github](https://github.com/Azornes/Comfyui-LayerForge/releases/tag/v1.2.4) or [LayerForge from manager Comfyui](https://registry.comfy.org/publishers/azornes/nodes/layerforge)
|
||||
|
||||
Make sure you have the latest versions before reporting an issue.
|
||||
- type: input
|
||||
id: environment
|
||||
attributes:
|
||||
label: Environment (OS, ComfyUI version, LayerForge version)
|
||||
placeholder: e.g. Windows 11, ComfyUI v0.3.43, LayerForge v1.2.4
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: input
|
||||
id: browser
|
||||
attributes:
|
||||
label: Browser & Version
|
||||
placeholder: e.g. Chrome 115.0.0, Firefox 120.1.0
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
id: what_happened
|
||||
attributes:
|
||||
label: What Happened?
|
||||
placeholder: Describe the issue you encountered
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
id: steps
|
||||
attributes:
|
||||
label: Steps to Reproduce
|
||||
placeholder: |
|
||||
1. …
|
||||
2. …
|
||||
3. …
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
id: expected
|
||||
attributes:
|
||||
label: Expected Behavior
|
||||
placeholder: Describe what you expected to happen
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
id: actual
|
||||
attributes:
|
||||
label: Actual Behavior
|
||||
placeholder: Describe what happened instead
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
id: console_logs
|
||||
attributes:
|
||||
label: Browser Console Logs
|
||||
description: |
|
||||
**How to capture logs:**
|
||||
- **Open console:**
|
||||
- Chrome/Edge (Win/Linux): `Ctrl+Shift+J`
|
||||
Mac: `Cmd+Option+J`
|
||||
- Firefox (Win/Linux): `Ctrl+Shift+K`
|
||||
Mac: `Cmd+Option+K`
|
||||
- Safari (Mac): enable **Develop** menu in Preferences → Advanced, then `Cmd+Option+C`
|
||||
- **Clear console** before reproducing:
|
||||
- Chrome/Edge: click “🚫 Clear console” or press `Ctrl+L` (Win/Linux) / `Cmd+K` (Mac)
|
||||
- Firefox: `Ctrl+Shift+L` (newer) or `Ctrl+L` (older) (Win/Linux), Mac: `Cmd+K`
|
||||
- Safari: click 🗑 icon or press `Cmd+K` / `Ctrl+L`
|
||||
- Reproduce the issue and paste new logs here.
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
**Optional:** You can also **attach a screenshot or video** to demonstrate the issue visually.
|
||||
To add media, simply drag & drop or paste image/video files into this issue form. GitHub supports common image formats and MP4/GIF files.
|
||||
24
.github/ISSUE_TEMPLATE/docs_request.yml
vendored
Normal file
24
.github/ISSUE_TEMPLATE/docs_request.yml
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
name: 📝 Documentation Request
|
||||
description: Suggest improvements or additions to documentation
|
||||
title: "[Docs] "
|
||||
labels: [documentation]
|
||||
body:
|
||||
- type: input
|
||||
id: doc_area
|
||||
attributes:
|
||||
label: Area of documentation
|
||||
placeholder: e.g. Getting started, Node API, Deployment guide
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: current_issue
|
||||
attributes:
|
||||
label: What's wrong or missing?
|
||||
placeholder: Describe the gap or confusing part
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: suggested_content
|
||||
attributes:
|
||||
label: How should it be improved?
|
||||
placeholder: Provide concrete suggestions or examples
|
||||
143
.github/workflows/ComfyUIdownloads.yml
vendored
Normal file
143
.github/workflows/ComfyUIdownloads.yml
vendored
Normal file
@@ -0,0 +1,143 @@
|
||||
name: LayerForge Top Downloads Badge
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: "0 0,8,16 * * *"
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: gh login
|
||||
run: echo "${{ secrets.SECRET_TOKEN }}" | gh auth login --with-token
|
||||
|
||||
- name: Query LayerForge API 20 times and find top download
|
||||
run: |
|
||||
max_downloads=0
|
||||
top_node_json="{}"
|
||||
|
||||
for i in {1..20}; do
|
||||
echo "Pobieranie danych z próby $i..."
|
||||
curl -s https://api.comfy.org/nodes/layerforge > tmp_$i.json
|
||||
|
||||
if [ ! -s tmp_$i.json ] || ! jq empty tmp_$i.json 2>/dev/null; then
|
||||
echo "Błąd: Nieprawidłowy JSON dla próby $i"
|
||||
continue
|
||||
fi
|
||||
|
||||
if jq -e 'type == "array"' tmp_$i.json >/dev/null; then
|
||||
# Przeszukanie wszystkich węzłów w tablicy
|
||||
node_count=$(jq 'length' tmp_$i.json)
|
||||
echo "Znaleziono $node_count węzłów w próbie $i"
|
||||
|
||||
for j in $(seq 0 $((node_count - 1))); do
|
||||
downloads=$(jq -r ".[$j].downloads // 0" tmp_$i.json)
|
||||
name=$(jq -r ".[$j].name // \"\"" tmp_$i.json)
|
||||
|
||||
if [ "$downloads" -gt "$max_downloads" ]; then
|
||||
max_downloads=$downloads
|
||||
top_node_json=$(jq ".[$j]" tmp_$i.json)
|
||||
echo "Nowe maksimum znalezione: $downloads (węzeł: $name)"
|
||||
fi
|
||||
done
|
||||
else
|
||||
downloads=$(jq -r '.downloads // 0' tmp_$i.json)
|
||||
name=$(jq -r '.name // ""' tmp_$i.json)
|
||||
|
||||
if [ "$downloads" -gt "$max_downloads" ]; then
|
||||
max_downloads=$downloads
|
||||
top_node_json=$(cat tmp_$i.json)
|
||||
echo "Nowe maksimum znalezione: $downloads (węzeł: $name)"
|
||||
fi
|
||||
fi
|
||||
|
||||
rm -f tmp_$i.json
|
||||
done
|
||||
|
||||
if [ "$max_downloads" -gt 0 ]; then
|
||||
echo "$top_node_json" > top_layerforge.json
|
||||
echo "Najwyższa liczba pobrań: $max_downloads"
|
||||
echo "Szczegóły węzła:"
|
||||
jq . top_layerforge.json
|
||||
else
|
||||
echo "Błąd: Nie znaleziono żadnych prawidłowych danych"
|
||||
# Utworzenie domyślnego JSON-a
|
||||
echo '{"name": "No data", "downloads": 0}' > top_layerforge.json
|
||||
fi
|
||||
|
||||
- name: create or update gist with top download
|
||||
id: set_id
|
||||
run: |
|
||||
if gh secret list | grep -q "LAYERFORGE_GIST_ID"
|
||||
then
|
||||
echo "GIST_ID found"
|
||||
echo "GIST=${{ secrets.LAYERFORGE_GIST_ID }}" >> $GITHUB_OUTPUT
|
||||
|
||||
# Sprawdzenie czy gist istnieje
|
||||
if gh gist view ${{ secrets.LAYERFORGE_GIST_ID }} &>/dev/null; then
|
||||
echo "Gist istnieje, będzie zaktualizowany"
|
||||
else
|
||||
echo "Gist nie istnieje, tworzenie nowego"
|
||||
gist_id=$(gh gist create top_layerforge.json | awk -F / '{print $NF}')
|
||||
echo $gist_id | gh secret set LAYERFORGE_GIST_ID
|
||||
echo "GIST=$gist_id" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
else
|
||||
echo "Tworzenie nowego gist"
|
||||
gist_id=$(gh gist create top_layerforge.json | awk -F / '{print $NF}')
|
||||
echo $gist_id | gh secret set LAYERFORGE_GIST_ID
|
||||
echo "GIST=$gist_id" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
- name: create badge if needed
|
||||
run: |
|
||||
COUNT=$(jq '.downloads' top_layerforge.json)
|
||||
NAME=$(jq -r '.name' top_layerforge.json)
|
||||
if [ ! -f LAYERFORGE.md ]; then
|
||||
shields="https://img.shields.io/badge/dynamic/json?color=informational&label=TopLayerForge&query=downloads&url="
|
||||
url="https://gist.githubusercontent.com/${{ github.actor }}/${{ steps.set_id.outputs.GIST }}/raw/top_layerforge.json"
|
||||
repo="https://comfy.org"
|
||||
echo ''> LAYERFORGE.md
|
||||
echo '
|
||||
**Markdown**
|
||||
|
||||
```markdown' >> LAYERFORGE.md
|
||||
echo "[]($repo)" >> LAYERFORGE.md
|
||||
echo '
|
||||
```
|
||||
|
||||
**HTML**
|
||||
```html' >> LAYERFORGE.md
|
||||
echo "<a href='$repo'><img alt='Top LayerForge Node' src='$shields$url'></a>" >> LAYERFORGE.md
|
||||
echo '```' >> LAYERFORGE.md
|
||||
|
||||
git add LAYERFORGE.md
|
||||
git config --global user.name "GitHub Action"
|
||||
git config --global user.email "action@github.com"
|
||||
git commit -m "Create LayerForge badge"
|
||||
fi
|
||||
|
||||
- name: Update Gist
|
||||
run: |
|
||||
# Upewnienie się, że JSON jest poprawny
|
||||
if jq empty top_layerforge.json 2>/dev/null; then
|
||||
content=$(jq -c . top_layerforge.json)
|
||||
echo "{\"description\": \"Top LayerForge Node\", \"files\": {\"top_layerforge.json\": {\"content\": $(jq -Rs . <<< "$content")}}}" > patch.json
|
||||
|
||||
curl -s -X PATCH \
|
||||
--user "${{ github.actor }}:${{ secrets.SECRET_TOKEN }}" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d @patch.json https://api.github.com/gists/${{ steps.set_id.outputs.GIST }}
|
||||
else
|
||||
echo "Błąd: Nieprawidłowy JSON w top_layerforge.json"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- name: Push
|
||||
uses: ad-m/github-push-action@master
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
31
.github/workflows/release.yml
vendored
31
.github/workflows/release.yml
vendored
@@ -1,4 +1,4 @@
|
||||
name: Auto Release with Version Patch and Commit Message
|
||||
name: Auto Release with Version Check
|
||||
|
||||
on:
|
||||
push:
|
||||
@@ -19,28 +19,24 @@ jobs:
|
||||
base=$(grep '^version *= *"' pyproject.toml | sed -E 's/version *= *"([^"]+)"/\1/')
|
||||
echo "base_version=$base" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Determine unique version tag
|
||||
- name: Check if tag for this version already exists
|
||||
run: |
|
||||
TAG="v${{ steps.version.outputs.base_version }}"
|
||||
git fetch --tags
|
||||
if git rev-parse "$TAG" >/dev/null 2>&1; then
|
||||
echo "Tag $TAG already exists. Skipping release."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
- name: Set version tag
|
||||
id: unique_tag
|
||||
run: |
|
||||
BASE="v${{ steps.version.outputs.base_version }}"
|
||||
TAG=$BASE
|
||||
COUNT=0
|
||||
|
||||
# Fetch remote tags
|
||||
git fetch --tags
|
||||
|
||||
while git rev-parse "$TAG" >/dev/null 2>&1; do
|
||||
COUNT=$((COUNT + 1))
|
||||
TAG="$BASE.$COUNT"
|
||||
done
|
||||
|
||||
echo "final_tag=$TAG" >> $GITHUB_OUTPUT
|
||||
echo "final_tag=v${{ steps.version.outputs.base_version }}" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Get latest commit message
|
||||
id: last_commit
|
||||
run: |
|
||||
msg=$(git log -1 --pretty=%B)
|
||||
# Zamiana nowych linii na \n aby ładnie wyświetlać w release body
|
||||
msg=${msg//$'\n'/\\n}
|
||||
echo "commit_msg=$msg" >> $GITHUB_OUTPUT
|
||||
|
||||
@@ -51,8 +47,7 @@ jobs:
|
||||
name: Release ${{ steps.unique_tag.outputs.final_tag }}
|
||||
body: |
|
||||
📦 Release based on pyproject.toml version `${{ steps.version.outputs.base_version }}`
|
||||
🔁 Auto-postfix to avoid duplicate tag: `${{ steps.unique_tag.outputs.final_tag }}`
|
||||
|
||||
|
||||
📝 Last commit message:
|
||||
```
|
||||
${{ steps.last_commit.outputs.commit_msg }}
|
||||
|
||||
Reference in New Issue
Block a user