161 lines
14 KiB
Plaintext
161 lines
14 KiB
Plaintext
本轮获取/整理脚本及原日志,仅复现证据,不要求重新联网;脚本只读准确文本,未导入上游。
|
|
|
|
--- setup-anima.py ---
|
|
from pathlib import Path
|
|
import json,hashlib,os,datetime,subprocess,concurrent.futures
|
|
R=Path.cwd();REF=R/'docs/hel-892/anima-klein-reference';OUT=R/'docs/hel-892/anima-klein-document-evidence';REF.mkdir(exist_ok=True);OUT.mkdir(exist_ok=True);now=datetime.datetime.now(datetime.timezone.utc).isoformat();rows=[]
|
|
def reuse(folder,oldid,newid,files=None):
|
|
p=R/'docs/hel-892'/folder/'sources.json';xs=json.loads(p.read_bytes())['sources']
|
|
for e in xs:
|
|
if e['id']!=oldid or (files is not None and e['file'] not in files):continue
|
|
if any(x['id']==newid and x['file']==e['file'] for x in rows):continue
|
|
e=dict(e,id=newid,reverified_at=now,applicability='本图准确逐节点静态来源;原获取时间保留,不执行或认证目标安装/恢复')
|
|
for k in ['local_file','license_file','identity_root']:
|
|
if k in e and not e[k].startswith('未知'):e[k]=os.path.relpath((p.parent/e[k]).resolve(),REF)
|
|
assert hashlib.sha256((REF/e['local_file']).read_bytes()).hexdigest()==e['sha256'];rows.append(e)
|
|
reuse('zimage-hd-reference','frontend','frontend');reuse('zimage-hd-reference','litegraph','litegraph')
|
|
reuse('flux2-lineart-reference','cr','cr');reuse('flux2-lineart-reference','layer','layer', ['__init__.py','py/purge_vram.py','py/image_scale_by_aspect_ratio_v2.py','py/imagefunc.py','LICENSE'])
|
|
reuse('flux2-img-reference','tt','tt');reuse('zimage-generalb-reference','rgnew','rgseed',['__init__.py','py/seed.py','py/constants.py','web/comfyui/seed.js','web/comfyui/base_node.js','web/comfyui/utils.js','LICENSE','pyproject.toml'])
|
|
reuse('zimage-hd-reference','rgpkg','rgpkg');reuse('krea-auto-reference','llama-unavailable','llama-unavailable')
|
|
# Package classes already audited; locate just exact two package identities.
|
|
for p in (R/'docs/hel-892').glob('*reference/sources.json'):
|
|
xs=json.loads(p.read_bytes());xs=xs.get('sources',[]) if isinstance(xs,dict) else xs
|
|
for e in xs:
|
|
if isinstance(e,dict) and 'member_crc32' in e and e.get('tag')=='1.0.0' and e.get('id') in ['reserved','dynamic','ramcache','reservedvram','dynamicram','ram']:
|
|
reuse(p.parent.name,e['id'],e['id'])
|
|
# Accurate core versions/selected declarations.
|
|
specs=[('core0340','Comfy-Org/ComfyUI','v0.3.40',['nodes.py','comfy/samplers.py','LICENSE','requirements.txt']),('core0365','Comfy-Org/ComfyUI','v0.3.65',['nodes.py','LICENSE','requirements.txt']),('core0200','Comfy-Org/ComfyUI','v0.20.0',['nodes.py','comfy_extras/nodes_preview_any.py','LICENSE','requirements.txt']),('core0292','Comfy-Org/ComfyUI','v0.29.2',['nodes.py','LICENSE','requirements.txt']),('core0110','Comfy-Org/ComfyUI','v0.11.0',['nodes.py','LICENSE','requirements.txt']),('core092','Comfy-Org/ComfyUI','v0.9.2',['nodes.py','LICENSE','requirements.txt']),('core082','Comfy-Org/ComfyUI','v0.8.2',['nodes.py','comfy_extras/nodes_custom_sampler.py','comfy_extras/nodes_flux.py','comfy_extras/nodes_edit_model.py','comfy/samplers.py','comfy_api/latest/_io.py','comfy_api/latest/_io_public.py','LICENSE','requirements.txt']),('kjjoin','kijai/ComfyUI-KJNodes','fb9d5764d21d23a3f52186aeccbb259efac96f9c',['__init__.py','nodes/nodes.py','web/js/joinstrings.js','LICENSE','requirements.txt','pyproject.toml']),('kjint','kijai/ComfyUI-KJNodes','4d46ac107c33ed8a3d181b8776ede66498583380',['__init__.py','nodes/nodes.py','LICENSE','requirements.txt','pyproject.toml'])]
|
|
def fetch(spec):
|
|
key,repo,rev,files=spec;cache=R/('.local-evidence/anima-'+key+'-git');subprocess.run(['git','init','--bare',str(cache)],check=True,capture_output=True)
|
|
def git(*args):return subprocess.check_output(['git','-C',str(cache),*args],timeout=80)
|
|
p=subprocess.run(['git','-C',str(cache),'fetch','--filter=blob:none','--depth=1','https://github.com/'+repo+'.git',rev],capture_output=True,timeout=100);(REF/(key+'-fetch.txt')).write_bytes(p.stdout+p.stderr);assert p.returncode==0,p.stderr
|
|
commit=git('rev-parse','FETCH_HEAD^{commit}').decode().strip();obj=git('rev-parse','FETCH_HEAD').decode().strip();tree=git('rev-parse',commit+'^{tree}').decode().strip();cb=git('cat-file','commit',commit);tb=git('cat-file','tag' if obj!=commit else 'commit',obj);(REF/(key+'-commit.txt')).write_bytes(cb);(REF/(key+'-tag.txt')).write_bytes(tb);(REF/(key+'-tag.json')).write_text(json.dumps(dict(object=obj,commit=commit,tag=rev),indent=2)+'\n')
|
|
entries=[]
|
|
for line in git('ls-tree','-r',commit).decode().splitlines():
|
|
meta,path=line.split('\t');mode,typ,sha=meta.split();entries.append(dict(path=path,mode=mode,type=typ,sha=sha))
|
|
(REF/(key+'-tree.json')).write_text(json.dumps(dict(sha=tree,truncated=False,tree=entries),indent=2)+'\n');result=[]
|
|
for f in files:
|
|
ent=next((x for x in entries if x['path']==f),None)
|
|
if not ent:print('MISSING',key,f,flush=True);continue
|
|
raw=git('show',commit+':'+f);assert len(raw)<3000000;name=key+'__'+f.replace('/','__');(REF/name).write_bytes(raw)
|
|
result.append(dict(id=key,repo=repo,file=f,local_file=name,commit=commit,tree=tree,tag=rev,url=f'https://raw.githubusercontent.com/{repo}/{commit}/{f}',sha256=hashlib.sha256(raw).hexdigest(),git_blob_sha1=ent['sha'],acquisition_time=now,reverified_at=now,license_file=key+'__LICENSE',identity_root='.',identity_key=key,transport='filtered Git necessary text only',applicability='本图独立准确版本静态核准,不执行或认证安装/恢复'))
|
|
print('FETCH',key,commit,len(result),flush=True);return result
|
|
with concurrent.futures.ThreadPoolExecutor(max_workers=5) as pool:
|
|
for result in pool.map(fetch,specs):rows+=result
|
|
(REF/'sources.json').write_text(json.dumps(dict(sources=rows),ensure_ascii=False,indent=2)+'\n');print('ROWS',len(rows))
|
|
|
|
--- extend-anima.py ---
|
|
from pathlib import Path
|
|
import json,os,hashlib,subprocess,datetime,urllib.request
|
|
R=Path.cwd();REF=R/'docs/hel-892/anima-klein-reference';p=REF/'sources.json';rows=json.loads(p.read_bytes())['sources'];now=datetime.datetime.now(datetime.timezone.utc).isoformat()
|
|
def reuse(folder,oldid,newid):
|
|
path=R/'docs/hel-892'/folder/'sources.json'
|
|
for e in json.loads(path.read_bytes())['sources']:
|
|
if e['id']!=oldid:continue
|
|
if any(x['id']==newid and x['file']==e['file'] for x in rows):continue
|
|
e=dict(e,id=newid,reverified_at=now)
|
|
for k in ['local_file','license_file','identity_root']:
|
|
if k in e and not e[k].startswith('未知'):e[k]=os.path.relpath((path.parent/e[k]).resolve(),REF)
|
|
e['acquisition_time']=e.get('acquisition_time','历史已审获取,原manifest未记录时刻,非本轮新获取');rows.append(e)
|
|
reuse('zimage-qwen-reference','reservedvram','reservedvram');reuse('zimage-qwen-reference','dynamic-ramcache','dynamic-ramcache')
|
|
def add(key,files):
|
|
e=next(x for x in rows if x['id']==key);cache=R/('.local-evidence/anima-'+key+'-git');tree=json.loads((REF/(key+'-tree.json')).read_bytes())
|
|
for f in files:
|
|
ent=next(x for x in tree['tree'] if x['path']==f);raw=subprocess.check_output(['git','-C',str(cache),'show',e['commit']+':'+f]);name=key+'__'+f.replace('/','__');(REF/name).write_bytes(raw);rows.append(dict(e,file=f,local_file=name,git_blob_sha1=ent['sha'],sha256=hashlib.sha256(raw).hexdigest(),acquisition_time=now,url=f"https://raw.githubusercontent.com/{e['repo']}/{e['commit']}/{f}"))
|
|
add('kjjoin',['web/js/jsnodes.js'])
|
|
# Seed exact current Git record already carries necessary frontend; take missing required members from its original identity cache using filtered Git only.
|
|
e=next(x for x in rows if x['id']=='rgseed'); print('seed members',[x['file'] for x in rows if x['id']=='rgseed'])
|
|
# Registry identity for three accurate source providers; source content is not executed.
|
|
for key,cnr,repo in [('kj','comfyui-kjnodes','https://github.com/kijai/ComfyUI-KJNodes'),('cr','ComfyUI_Comfyroll_CustomNodes',None),('layer','comfyui_layerstyle',None)]:
|
|
try:
|
|
url='https://api.comfy.org/nodes/'+cnr
|
|
with urllib.request.urlopen(url,timeout=25) as s:raw=s.read(500001)
|
|
assert len(raw)<500001;(REF/(key+'-registry.json')).write_bytes(raw);print('registry',key,json.loads(raw).get('repository'))
|
|
except Exception as ex:print('registry bounded failure',key,type(ex).__name__,str(ex))
|
|
p.write_text(json.dumps(dict(sources=rows),ensure_ascii=False,indent=2)+'\n');print('rows',len(rows))
|
|
|
|
--- anima-source-add.py ---
|
|
from pathlib import Path
|
|
import subprocess,json,hashlib,datetime,os
|
|
R=Path.cwd();REF=R/'docs/hel-892/anima-klein-reference';p=REF/'sources.json';rows=json.loads(p.read_bytes())['sources'];now=datetime.datetime.now(datetime.timezone.utc).isoformat()
|
|
e=next(x for x in rows if x['id']=='rgseed');root=REF/e['identity_root'];tree=json.loads((root/(e['identity_key']+'-tree.json')).read_bytes());files=['py/seed.py','web/comfyui/seed.js','web/comfyui/base_node.js','web/comfyui/utils.js','LICENSE','pyproject.toml'];cache=R/'.local-evidence/anima-rgseed-git';subprocess.run(['git','init','--bare',str(cache)],check=True,capture_output=True);subprocess.run(['git','-C',str(cache),'fetch','--filter=blob:none','--depth=1','https://github.com/'+e['repo']+'.git',e['commit']],check=True,capture_output=True)
|
|
for f in files:
|
|
if any(x['id']=='rgseed' and x['file']==f for x in rows):continue
|
|
ent=next((x for x in tree['tree'] if x['path']==f),None)
|
|
if not ent:print('MISSING',f);continue
|
|
raw=subprocess.check_output(['git','-C',str(cache),'show',e['commit']+':'+f]);name='rgseed__'+f.replace('/','__');(REF/name).write_bytes(raw);rows.append(dict(e,file=f,local_file=name,git_blob_sha1=ent['sha'],sha256=hashlib.sha256(raw).hexdigest(),acquisition_time=now,reverified_at=now,url=f"https://raw.githubusercontent.com/{e['repo']}/{e['commit']}/{f}"))
|
|
# Attach package provenance for inherited exact saved members, preserving original package acquisition facts.
|
|
for e in rows:
|
|
if e['id'] in ['reservedvram','dynamic-ramcache']:
|
|
e['identity_root']='../zimage-qwen-reference';e['identity_key']=e['id'];e['package_record']=f"../zimage-qwen-reference/{e['id']}-package.json";e['registry_record']=f"../zimage-qwen-reference/{e['id']}-registry.json"
|
|
for e in rows:e.setdefault('license_file','未知:原准确清单未包含许可文本')
|
|
# Rebind exact license bytes to a row in this manifest.
|
|
for e in rows:
|
|
if not e['license_file'].startswith('未知') and (REF/e['license_file']).is_file():
|
|
lic=(REF/e['license_file']).read_bytes();same=next((x for x in rows if x['id']==e['id'] and (REF/x['local_file']).read_bytes()==lic),None);assert same,e;e['license_file']=same['local_file']
|
|
|
|
for e in rows:
|
|
if not e['license_file'].startswith('未知') and not (REF/e['license_file']).is_file():e['license_file']='未知:准确Git树无LICENSE,原清单记录许可文本未知'
|
|
p.write_text(json.dumps(dict(sources=rows),ensure_ascii=False,indent=2)+'\n');print('rows',len(rows))
|
|
|
|
--- anima-exact-more.py ---
|
|
from pathlib import Path
|
|
import json,subprocess,datetime,hashlib,concurrent.futures
|
|
R=Path.cwd();REF=R/'docs/hel-892/anima-klein-reference';now=datetime.datetime.now(datetime.timezone.utc).isoformat();p=REF/'sources.json';rows=json.loads(p.read_bytes())['sources'];rows=[e for e in rows if e['id'] not in ['cr','layer','tt']]
|
|
s=Path('.local-evidence/setup-anima.py').read_text();start=s.index('def fetch(spec):');end=s.index('with concurrent.futures.ThreadPoolExecutor',start);exec(s[start:end])
|
|
specs=[('cr','Suzie1/ComfyUI_Comfyroll_CustomNodes','d78b780ae43fcf8c6b7c6505e6ffb4584281ceca',['__init__.py','node_mappings.py','nodes/nodes_utils_text.py','LICENSE','requirements.txt','pyproject.toml']),('layer','chflame163/ComfyUI_LayerStyle','d94bef1ee5ed3656f5ff1bb2830a4ffd94f40935',['__init__.py','py/purge_vram.py','py/image_scale_by_aspect_ratio_v2.py','py/imagefunc.py','LICENSE','requirements.txt','pyproject.toml']),('tt','AICoderTudou/ComfyUI-TT-Resolution_selector-Node','b69cf75c2ce5f864e3db5301dba46a6b5eeaa8fb',['__init__.py','nodes/resolution_selector.py','LICENSE','requirements.txt','pyproject.toml'])]
|
|
with concurrent.futures.ThreadPoolExecutor(max_workers=3) as pool:
|
|
for res in pool.map(fetch,specs):rows+=res
|
|
for e in rows:
|
|
if e['id'] in ['cr','tt'] and not (REF/e['license_file']).exists():e['license_file']='未知:准确Git树无LICENSE文本'
|
|
p.write_text(json.dumps(dict(sources=rows),ensure_ascii=False,indent=2)+'\n')
|
|
|
|
--- setup-anima-log.txt ---
|
|
FETCH core0110 09725967cf76304371c390ca1d6483e04061da48 3
|
|
FETCH core0365 51696e3fdcdfad657cb15854345fbcbbe70eef8d 3
|
|
FETCH core0292 322122449c9d2ba8b8df1bb517364527dd0615f1 3
|
|
FETCH core0340 866f6cdab4bd5de95ee6296d1b418c455f67f929 4
|
|
FETCH core0200 75143eeb06b14bc93db71de207945f6f888be4e0 4
|
|
MISSING kjjoin web/js/joinstrings.js
|
|
FETCH core092 8f40b43e0204d5b9780f3e9618e140e929e80594 3
|
|
FETCH kjjoin fb9d5764d21d23a3f52186aeccbb259efac96f9c 5
|
|
FETCH kjint 4d46ac107c33ed8a3d181b8776ede66498583380 5
|
|
FETCH core082 2e9d51680a90bca9cc375ba7767f7bf3ed27d563 9
|
|
ROWS 72
|
|
|
|
--- extend-anima-log.txt ---
|
|
seed members ['__init__.py', 'py/constants.py', 'LICENSE']
|
|
registry kj https://github.com/kijai/ComfyUI-KJNodes
|
|
registry cr https://github.com/Suzie1/ComfyUI_Comfyroll_CustomNodes
|
|
registry layer https://github.com/chflame163/ComfyUI_LayerStyle
|
|
rows 80
|
|
|
|
--- anima-source-add.txt ---
|
|
Traceback (most recent call last):
|
|
File "/home/xiaomo/multica_workspaces/hello-af23464d222e/hel-892-8d94b12fc336/workdir/aigc-home/.local-evidence/anima-source-add.py", line 17, in <module>
|
|
lic=(REF/e['license_file']).read_bytes();same=next((x for x in rows if x['id']==e['id'] and (REF/x['local_file']).read_bytes()==lic),None);assert same,e;e['license_file']=same['local_file']
|
|
File "/usr/lib/python3.10/pathlib.py", line 1126, in read_bytes
|
|
with self.open(mode='rb') as f:
|
|
File "/usr/lib/python3.10/pathlib.py", line 1119, in open
|
|
return self._accessor.open(self, mode, buffering, encoding, errors,
|
|
FileNotFoundError: [Errno 2] No such file or directory: '/home/xiaomo/multica_workspaces/hello-af23464d222e/hel-892-8d94b12fc336/workdir/aigc-home/docs/hel-892/anima-klein-reference/../flux2-lineart-reference/原Git树无LICENSE,许可文本未知'
|
|
|
|
--- anima-source-add-final.txt ---
|
|
Traceback (most recent call last):
|
|
File "/home/xiaomo/multica_workspaces/hello-af23464d222e/hel-892-8d94b12fc336/workdir/aigc-home/.local-evidence/anima-source-add.py", line 16, in <module>
|
|
if not e['license_file'].startswith('未知') and (REF/e['license_file']).is_file():
|
|
KeyError: 'license_file'
|
|
|
|
--- anima-source-add-third.txt ---
|
|
rows 85
|
|
|
|
--- anima-exact-more.txt ---
|
|
MISSING tt LICENSE
|
|
MISSING tt requirements.txt
|
|
MISSING cr LICENSE
|
|
MISSING cr requirements.txt
|
|
MISSING cr pyproject.toml
|
|
FETCH cr d78b780ae43fcf8c6b7c6505e6ffb4584281ceca 3
|
|
FETCH tt b69cf75c2ce5f864e3db5301dba46a6b5eeaa8fb 3
|
|
FETCH layer d94bef1ee5ed3656f5ff1bb2830a4ffd94f40935 7
|