import torchfrom transformers import AutoModelForImageTextToText, AutoProcessor MODEL_ID = "Rom3rk/Qwen3.8-27B-ComfyUI"ENABLE_THINKING = False processor = AutoProcessor.from_pretrained(MODEL_ID)model = AutoModelForImageTextToText.from_pretrained( MODEL_ID, dtype=torch.bfloat16, device_map="auto",).eval() messages = [ { "role": "user", "content": [ { "type": "text", "text": ( "Create a ComfyUI UI workflow for an SDXL image-to-image " "pipeline with a ControlNet depth branch and return the " "complete loadable UI workflow JSON." ), } ], }] inputs = processor.apply_chat_template( messages, tokenize=True, add_generation_prompt=True, enable_thinking=ENABLE_THINKING, return_dict=True, return_tensors="pt",).to(model.device) with torch.inference_mode(): generated_ids = model.generate( **inputs, max_new_tokens=4096, do_sample=True, temperature=0.7, top_p=0.8, top_k=20, ) new_tokens = generated_ids[:, inputs.input_ids.shape[1]:]response = processor.batch_decode( new_tokens, skip_special_tokens=True, clean_up_tokenization_spaces=False,)[0] print(response)