I found a copy of A Critical Edition of The War of the Worlds: H. G. Wells's Scientific Romance, the "Introduction" section details what's known about the genesis of the novel based on documents like letters and drafts, they show that Wells had already had the idea and had done a lot of the writing prior to 1897 when Lasswitz's book was published. Here's part of the introduction on p.1 which details the original inspiration for the book in 1895:
In an 1888 debate, he upheld the proposition that "the surface of Mars was occupied by living beings,"3 which, he added in 1896, would not be humanoid (see Appendix IV). However, when he left London for suburban Surrey in March 1895, Wells seems to have had no conscious inkling of the book itself. It was shortly thereafter that his brother Frank suggested the idea of a Martian invasion. The two were strolling through the peaceful Surrey countryside when Frank remarked: "Suppose some beings from another planet were to drop out of the sky suddenly, and begin laying about them here!"4 About that time Wells and his wife had taken up bicycling, and he later recalled exploring Surrey and finding himself "marking down suitable places and people for destruction by my Martians."5 Frank's remark had fallen on fertile ground.
Footnote 4 after the quote from Frank Wells is 'Strand Magazine LIX (1920):154. Also, Wells dedicated the book to Frank as "this rendering of his idea."' Footnote 5 about his imagining places in Surrey marked for destruction is 'Experiments in Autobiography (1934), p. 458.'
The introduction goes on to discuss some letters from during the time he was writing it, here's the discussion of the ones from before 1897 (p. 1-2):
Actual composition took place in three spurts in the late summer and early fall of 1895, in the first half of 1896, and in the last quarter of 1897. Two letters mark the 1895 period. W. E. Henley remarks (September 5, 1895): "I am waiting with the greatest interest, the keenest curiosity, to see what comes of the Martialist visitation: the idea is so strong, & you are working it out with so much gusto, that I have great hopes of it."6 Wells himself, in a letter of October 15, said he had "in hand" and prospectively ready by "early in 1896" or sooner, "a scientific romance" that "will be called 'The War of the Worlds' & will run to perhaps 75000 words."7 But some months later the story was far from finished, and the second writing spurt is marked by a letter from the Authors' Syndicate to Wells and five from Wells to the Syndicate (early January to late March 1896) that show him hard at work on it. ... In April 1896, he had sold the British serial rights to Pearson's Magazine, promising "complete & finished copy no later than August 1st,"9
Page 2 of the introduction also discusses some surviving drafts of different sections of the story, three from 1897 which were revisions of the Pearson's Magazine version (labeled P), and two others from 1896, one of which contains an episode deleted from later published versions:
The surviving manuscripts came to the University of Illinois in five holograph sheaves, plus the Atlantic edition galleys. ... Three of the sheaves constitute Wells's revision of P for book publication ... The other two sheaves belong to 1896, before serial publication. The shorter is a draft of the narrator's closing philosophical reflection ... The longer (hereafter MS), the fragment transcribed and collated in Appendix I, begins when the narrator leaves the ruined house (in the chapter later entitled "The Stillness") and covers his wanderings in dead London and his homecoming. But between the ruined house and dead London it contains the hitherto unpublished "Marriott" segment. In due course, in L, "Marriott" would be replaced by PR3, "Putney Hill," the artilleryman episode.
Page 3 summarizes the "Marriott" (MS) segment:
The interesting, and earliest, document is MS, inasmuch as the "Marriott" segment—of just seven holograph pages—comprises an alternative plot line. As noted above, in all versions the narrator progresses from imprisonment above the Martian pit, to dead London, to homecoming. In P and L, the imprisonment is near London, at Sheen. In MS, imprisonment is at Byfleet, near home in Woking and wife in Leatherhead, and when the narrator escapes, he ceases searching for his wife only when kindly folks who feed him bear witness that the Heat-Ray must have killed her. He then turns dramatically north to London—packing a bomb procured in Kingston from the formidable Marriott—bent upon dying in a single-handed assault on the Martians' Primrose Hill redoubt (where of course they lie already dead).
P. 3-4 also mention that in the MS segment the narrator recalls some of the previous incidents, and based on how certain events were described we can infer that some events earlier in the narrative (like the Thunder Child battle) were added in revisions after he wrote the MS segment. P. 4 goes on to note that what he sent to Pearson did include a draft of the story before MS, although that draft of those earlier sections hasn't survived:
That Wells after completing MS went back and interpolated much at earlier points is further indicated by his five letters to the Authors' Syndicate and the one surviving response. The latter indicates that when negotiations for serialization began, the story was unfinished and very likely broke off somewhere near the point were MS begins. Pearson received an unfinished draft, liked it as far as it went, but wanted to see the conclusion. Wells adorned the request for his wife's amusement with a "picshua" (reproduced, with the letter, in Experiments in Autobiography) of a horned devil pulling an acceptable end to his "tale" from an ink pot preparatory to swapping it for a sack of money on the "serial chopping block." The sack is labeled "£200." The letter is dated March 14, 1896, and the latest date of the five letters on Wells's part is March 26.